import org.apache.commons.lang.StringUtils;
import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
import org.apache.cxf.jaxrs.client.WebClient;
+import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider;
import org.codehaus.redback.rest.services.AbstractRestServicesTest;
import org.junit.Before;
import javax.ws.rs.core.MediaType;
import java.io.File;
+import java.util.Collections;
import java.util.Date;
/**
{
RepositoriesService service =
JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
- RepositoriesService.class );
+ RepositoriesService.class,
+ Collections.singletonList( new JacksonJaxbJsonProvider() ) );
if ( authzHeader != null )
{
WebClient.client( service ).header( "Authorization", authzHeader );
}
WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 100000000 );
+ WebClient.client( service ).accept( MediaType.APPLICATION_JSON_TYPE );
+ WebClient.client( service ).type( MediaType.APPLICATION_JSON_TYPE );
return service;
}
{
ManagedRepositoriesService service =
JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
- ManagedRepositoriesService.class );
+ ManagedRepositoriesService.class,
+ Collections.singletonList( new JacksonJaxbJsonProvider() ) );
if ( authzHeader != null )
{
WebClient.client( service ).header( "Authorization", authzHeader );
}
WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 100000000 );
+ WebClient.client( service ).accept( MediaType.APPLICATION_JSON_TYPE );
+ WebClient.client( service ).type( MediaType.APPLICATION_JSON_TYPE );
return service;
}
protected PingService getPingService()
{
return JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
- PingService.class );
+ PingService.class,
+ Collections.singletonList( new JacksonJaxbJsonProvider() ) );
}
protected RemoteRepositoriesService getRemoteRepositoriesService()
{
return JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
- RemoteRepositoriesService.class );
+ RemoteRepositoriesService.class,
+ Collections.singletonList( new JacksonJaxbJsonProvider() ) );
}
protected RepositoryGroupService getRepositoryGroupService()
{
return JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
- RepositoryGroupService.class );
+ RepositoryGroupService.class,
+ Collections.singletonList( new JacksonJaxbJsonProvider() ) );
}
protected ProxyConnectorService getProxyConnectorService()
{
ProxyConnectorService service =
JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
- ProxyConnectorService.class );
+ ProxyConnectorService.class,
+ Collections.singletonList( new JacksonJaxbJsonProvider() ) );
WebClient.client( service ).header( "Authorization", authorizationHeader );
WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000 );
+ WebClient.client( service ).accept( MediaType.APPLICATION_JSON_TYPE );
+ WebClient.client( service ).type( MediaType.APPLICATION_JSON_TYPE );
return service;
}
{
NetworkProxyService service =
JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
- NetworkProxyService.class );
+ NetworkProxyService.class,
+ Collections.singletonList( new JacksonJaxbJsonProvider() ) );
WebClient.client( service ).header( "Authorization", authorizationHeader );
WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000 );
+ WebClient.client( service ).accept( MediaType.APPLICATION_JSON_TYPE );
+ WebClient.client( service ).type( MediaType.APPLICATION_JSON_TYPE );
return service;
}
{
ArchivaAdministrationService service =
JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
- ArchivaAdministrationService.class );
+ ArchivaAdministrationService.class,
+ Collections.singletonList( new JacksonJaxbJsonProvider() ) );
WebClient.client( service ).accept( MediaType.APPLICATION_JSON_TYPE );
WebClient.client( service ).type( MediaType.APPLICATION_JSON_TYPE );
// START SNIPPET: cxf-searchservice-creation
SearchService service =
JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
- SearchService.class );
+ SearchService.class,
+ Collections.singletonList( new JacksonJaxbJsonProvider() ) );
if ( authzHeader != null )
{
WebClient.client( service ).header( "Authorization", authzHeader );
}
WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 100000000 );
+ WebClient.client( service ).accept( MediaType.APPLICATION_JSON_TYPE );
+ WebClient.client( service ).type( MediaType.APPLICATION_JSON_TYPE );
return service;
// END SNIPPET: cxf-searchservice-creation
{
CommonServices service =
JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
- CommonServices.class );
+ CommonServices.class,
+ Collections.singletonList( new JacksonJaxbJsonProvider() ) );
if ( authzHeader != null )
{
WebClient.client( service ).header( "Authorization", authzHeader );
}
WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 100000000 );
+ WebClient.client( service ).accept( MediaType.APPLICATION_JSON_TYPE );
+ WebClient.client( service ).type( MediaType.APPLICATION_JSON_TYPE );
return service;
}
<httpclient.core.version>4.1.4</httpclient.core.version>
<javaxMailVersion>1.4</javaxMailVersion>
<jettyVersion>7.4.5.v20110725</jettyVersion>
+ <jacksonVersion>1.9.5</jacksonVersion>
<!-- restore when we will be able to use a derby in memory database -->
<redbackTestJdbcUrl>jdbc:derby:memory:users-test;create=true</redbackTestJdbcUrl>
<redbackTestJdbcDriver>org.apache.derby.jdbc.EmbeddedDriver</redbackTestJdbcDriver>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
- <version>1.9.5</version>
+ <version>${jacksonVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-xc</artifactId>
+ <version>${jacksonVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-core-asl</artifactId>
+ <version>${jacksonVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.codehaus.jettison</groupId>
+ <artifactId>jettison</artifactId>
+ </exclusion>
</exclusions>
</dependency>