Search in sources :

Example 1 with CommonServices

use of org.apache.archiva.rest.api.services.CommonServices in project archiva by apache.

the class AbstractArchivaRestTest method getCommonServices.

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

Example 2 with CommonServices

use of org.apache.archiva.rest.api.services.CommonServices in project archiva by apache.

the class CommonServicesTest method validCronExpression.

@Test
public void validCronExpression() throws Exception {
    CommonServices commonServices = getCommonServices(null);
    assertTrue(commonServices.validateCronExpression("0 0,30 * * * ?"));
}
Also used : CommonServices(org.apache.archiva.rest.api.services.CommonServices) Test(org.junit.Test)

Example 3 with CommonServices

use of org.apache.archiva.rest.api.services.CommonServices in project archiva by apache.

the class CommonServicesTest method nonValidCronExpression.

@Test
public void nonValidCronExpression() throws Exception {
    CommonServices commonServices = getCommonServices(null);
    assertFalse(commonServices.validateCronExpression("0,30 * * * ?"));
}
Also used : CommonServices(org.apache.archiva.rest.api.services.CommonServices) Test(org.junit.Test)

Aggregations

CommonServices (org.apache.archiva.rest.api.services.CommonServices)3 Test (org.junit.Test)2 JacksonJaxbJsonProvider (com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider)1