Skip to content

Make TestHTTPEndpoint at class level affect all URL fields in test classes #34935

@gian1200

Description

@gian1200

Description

When working with @TestHTTPEndpoint, @TestHTTPResource and URL field type; one must annotate the field with both.

It is also possible to annotate the @QuarkusTest class with @TestHTTPEndpoint to make Rest Assured pick the the correct path and prefix it.

The issue happens when having multiple paths inside a single "Resource class". It feels a little redundant. Something like:

@QuarkusTest
class XXXResourceTest {

	@TestHTTPEndpoint(XXXResource.class)
	@TestHTTPResource("path1")
	URL endpoint1;

	@TestHTTPEndpoint(XXXResource.class)
	@TestHTTPResource("path2")
	URL endpoint2;

	@TestHTTPEndpoint(XXXResource.class)
	@TestHTTPResource("path3")
	URL endpoint3;

	// Tests...
}

Implementation ideas

It'd be nice to be able to do something like this and get the same result:

@QuarkusTest
@TestHTTPEndpoint(XXXResource.class)
class XXXResourceTest {

	@TestHTTPResource("path1")
	URL endpoint1;

	@TestHTTPResource("path2")
	URL endpoint2;

	@TestHTTPResource("path3")
	URL endpoint3;

	// Tests...
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions