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;
}
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 * * * ?"));
}
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 * * * ?"));
}
Aggregations