-
1. Re: Arquillian REST Extension webtarget
raneves Sep 1, 2015 8:52 AM (in response to alkhan)Hi,
myabe you need use ResteasyWebTarget class.
like that:
@Test
public
void
createPackageBareRsource(
@ArquillianResteasyResource
(
"rest/customer"
) ResteasyWebTarget webTarget)
{
// Given
final
Invocation.Builder invocationBuilder = webTarget.request();
invocationBuilder.acceptEncoding(
"UTF-8"
);
invocationBuilder.accept(MediaType.APPLICATION_ATOM_XML_TYPE);
final
Invocation invocation = invocationBuilder.buildPost(Entity.entity(
"{\"biskupa\":\"?upa\"}"
, MediaType.APPLICATION_JSON_TYPE));
// When
final
Response response = invocation.invoke();
// Then
assertEquals(deploymentURL +
"rest/customer"
, webTarget.getUri().toASCIIString());
assertEquals(MediaType.APPLICATION_JSON, response.getMediaType().toString());
assertEquals(HttpStatus.SC_OK, response.getStatus());
}
And your dependencies:
<
dependency
>
<
groupId
>org.jboss.arquillian.extension</
groupId
>
<
artifactId
>arquillian-rest-client-api</
artifactId
>
<
version
>1.0.0.Final-SNAPSHOT</
version
>
<
scope
>test</
scope
>
</
dependency
>
<
dependency
>
<
groupId
>org.jboss.arquillian.extension</
groupId
>
<
artifactId
>arquillian-rest-client-impl-3x</
artifactId
>
<
version
>1.0.0.Final-SNAPSHOT</
version
>
<
scope
>test</
scope
>
</
dependency
>
<
dependency
>
<
groupId
>org.jboss.resteasy</
groupId
>
<
artifactId
>resteasy-jackson-provider</
artifactId
>
<
version
>${version.resteasy}</
version
>
<
scope
>test</
scope
>
</
dependency
>
see more here Arquillian REST Extension - Client - IT Crowd Blog
-
2. Re: Arquillian REST Extension webtarget
alkhan Sep 2, 2015 3:24 AM (in response to raneves)This changes nothing, I have the same problem with ResteasyWebTarget!
-
3. Re: Arquillian REST Extension webtarget
pitchblack1408 Apr 26, 2018 1:40 PM (in response to alkhan)I know this is an old post and may sound silly, but I was having the same issue. At first fixing the pom dependencies didn't seem to do anything , so I manually made NetBeans reload all dependencies from maven repo. Then the project was able to resolve the dependencies and I was able to use the ArquillianResteasyResource annotaion.
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-rest-client-api</artifactId>
<version>${version.arquillian.rest}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-rest-client-impl-3x</artifactId>
<version>${version.arquillian.rest}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson-provider</artifactId>
<version>${version.resteasy}</version>
<scope>test</scope>
</dependency>