Make the GraphQLWebClientImpl public or provide a way to use it on tests
ignaciolarranaga opened this issue · 1 comments
Is your feature request related to a problem? Please describe.
It seems to be no way to create dynamic port tests because there is no way to inject the dynamic port.
I'm trying to do something like https://github.com/graphql-java-kickstart/graphql-spring-webclient/blob/master/graphql-webclient/src/test/java/graphql/kickstart/spring/webclient/boot/GraphQLWebClientTest.java#L36
@BeforeEach
void beforeEach() {
WebClient webClient = WebClient.builder()
.baseUrl("http://localhost:" + randomServerPort + "/graphql")
.build();
graphqlClient = new GraphQLWebClientImpl(webClient, objectMapper);
}
but seems to be impossible because the classes are package.
Please notice it can not be injected on configuration (that's why I think it was implemented on beforeEach()).
Describe the solution you'd like
Either make the classes and interfaces public or provide an alternative approach.
Describe alternatives you've considered
N/A
Additional context
N/A
Good point! I've added a static factory method to GraphQLWebClient
, so you can use
GraphQLWebClient.newInstance(webClient, objectMapper)
It's available in the snapshot build for now.