Search in sources :

Example 6 with JacksonJaxbJsonProvider

use of com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider in project archiva by apache.

the class AbstractArchivaRestTest method getNetworkProxyService.

protected NetworkProxyService getNetworkProxyService() {
    NetworkProxyService service = JAXRSClientFactory.create(getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/", NetworkProxyService.class, Collections.singletonList(new JacksonJaxbJsonProvider()));
    WebClient.client(service).header("Authorization", authorizationHeader);
    WebClient.client(service).header("Referer", "http://localhost:" + port);
    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;
}
Also used : JacksonJaxbJsonProvider(com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider) NetworkProxyService(org.apache.archiva.rest.api.services.NetworkProxyService)

Example 7 with JacksonJaxbJsonProvider

use of com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider in project archiva by apache.

the class AbstractArchivaRestTest method getRedbackRuntimeConfigurationService.

protected RedbackRuntimeConfigurationService getRedbackRuntimeConfigurationService() {
    RedbackRuntimeConfigurationService service = JAXRSClientFactory.create(getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/", RedbackRuntimeConfigurationService.class, Collections.singletonList(new JacksonJaxbJsonProvider()));
    WebClient.client(service).accept(MediaType.APPLICATION_JSON_TYPE);
    WebClient.client(service).type(MediaType.APPLICATION_JSON_TYPE);
    WebClient.client(service).header("Authorization", authorizationHeader);
    WebClient.client(service).header("Referer", "http://localhost:" + port);
    WebClient.getConfig(service).getHttpConduit().getClient().setReceiveTimeout(300000);
    return service;
}
Also used : RedbackRuntimeConfigurationService(org.apache.archiva.rest.api.services.RedbackRuntimeConfigurationService) JacksonJaxbJsonProvider(com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider)

Example 8 with JacksonJaxbJsonProvider

use of com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider in project archiva by apache.

the class RuntimeInfoServiceTest method runtimeInfoService.

@Test
public void runtimeInfoService() throws Exception {
    RuntimeInfoService service = JAXRSClientFactory.create(getBaseUrl() + "/" + getRestServicesPath() + "/archivaUiServices/", RuntimeInfoService.class, Collections.singletonList(new JacksonJaxbJsonProvider()));
    WebClient.client(service).header("Referer", "http://localhost");
    ApplicationRuntimeInfo applicationRuntimeInfo = service.getApplicationRuntimeInfo("en");
    assertEquals(System.getProperty("expectedVersion"), applicationRuntimeInfo.getVersion());
    assertFalse(applicationRuntimeInfo.isJavascriptLog());
    assertTrue(applicationRuntimeInfo.isLogMissingI18n());
}
Also used : ApplicationRuntimeInfo(org.apache.archiva.web.model.ApplicationRuntimeInfo) RuntimeInfoService(org.apache.archiva.web.api.RuntimeInfoService) JacksonJaxbJsonProvider(com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider) AbstractRestServicesTest(org.apache.archiva.redback.rest.services.AbstractRestServicesTest) Test(org.junit.Test)

Example 9 with JacksonJaxbJsonProvider

use of com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider in project archiva by apache.

the class AbstractDownloadTest method getRepositoriesService.

protected RepositoriesService getRepositoriesService() {
    RepositoriesService service = JAXRSClientFactory.create(getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/", RepositoriesService.class, Collections.singletonList(new JacksonJaxbJsonProvider()));
    WebClient.client(service).header("Authorization", authorizationHeader);
    WebClient.client(service).header("Referer", "http://localhost:" + port);
    WebClient.getConfig(service).getHttpConduit().getClient().setReceiveTimeout(300000L);
    return service;
}
Also used : RepositoriesService(org.apache.archiva.rest.api.services.RepositoriesService) RemoteRepositoriesService(org.apache.archiva.rest.api.services.RemoteRepositoriesService) ManagedRepositoriesService(org.apache.archiva.rest.api.services.ManagedRepositoriesService) JacksonJaxbJsonProvider(com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider)

Example 10 with JacksonJaxbJsonProvider

use of com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider in project archiva by apache.

the class AbstractDownloadTest method getRoleManagementService.

protected RoleManagementService getRoleManagementService(String authzHeader) {
    RoleManagementService service = JAXRSClientFactory.create("http://localhost:" + port + "/" + getRestServicesPath() + "/redbackServices/", RoleManagementService.class, Collections.singletonList(new JacksonJaxbJsonProvider()));
    WebClient.client(service).header("Referer", "http://localhost:" + port);
    // for debuging purpose
    WebClient.getConfig(service).getHttpConduit().getClient().setReceiveTimeout(3000000L);
    if (authzHeader != null) {
        WebClient.client(service).header("Authorization", authzHeader);
    }
    return service;
}
Also used : RoleManagementService(org.apache.archiva.redback.rest.api.services.RoleManagementService) JacksonJaxbJsonProvider(com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider)

Aggregations

JacksonJaxbJsonProvider (com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider)35 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)5 ResourceConfig (org.glassfish.jersey.server.ResourceConfig)5 ArrayList (java.util.ArrayList)4 Test (org.junit.Test)4 ByteArrayInputStream (java.io.ByteArrayInputStream)3 URI (java.net.URI)3 Response (javax.ws.rs.core.Response)3 JacksonJsonProvider (com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider)2 Provides (com.google.inject.Provides)2 Singleton (com.google.inject.Singleton)2 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 Annotation (java.lang.annotation.Annotation)2 ElementType (java.lang.annotation.ElementType)2 Retention (java.lang.annotation.Retention)2 RetentionPolicy (java.lang.annotation.RetentionPolicy)2 Target (java.lang.annotation.Target)2 Method (java.lang.reflect.Method)2 Type (java.lang.reflect.Type)2