Hi,
how to test a MicroProfile Rest Client with jUnit? I can't find an example.
I build my test code like this:
URL apiUrl = new URL(base_uri);
MyService docService =
RestClientBuilder.newBuilder()
.baseUrl(apiUrl)
.build(MytService.class);
but I got the following exception in junit testing:
java.lang.IllegalStateException: No RestClientBuilderResolver implementation found!
at org.eclipse.microprofile.rest.client.spi.RestClientBuilderResolver.instance(RestClientBuilderResolver.java:84)
at org.eclipse.microprofile.rest.client.RestClientBuilder.newBuilder(RestClientBuilder.java:41)
at org.imixs.workflow.rest.WorkflowClientMicroprofile.getDocumentCustom(WorkflowClientMicroprofile.java:81)
at org.imixs.workflow.rest.TestReportServiceMicroprofile.testGetDocument(TestReportServiceMicroprofile.java:36)
.....
My maven dependenciesl looks like this:
<dependencies>
<!-- JEE Dependencies -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>
.....
<!-- microprofile-rest-client-api -->
<dependency>
<groupId>org.eclipse.microprofile.rest.client</groupId>
<artifactId>microprofile-rest-client-api</artifactId>
<version>1.0.1</version>
</dependency>
<!-- JUnit Tests -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<!-- JAX-RS 2.0 Test dependencies -->
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>2.27</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
<version>3.0.15</version>
<scope>test</scope>
</dependency>
</dependencies>
Can anybody give me a short example?
===
Ralph