use of org.apache.cxf.xkms.model.xkms.RegisterResultType in project cxf by apache.
the class XKMSServiceTest method testEmptyRegister.
@Test
public void testEmptyRegister() throws URISyntaxException, Exception {
RegisterRequestType request = new RegisterRequestType();
setGenericRequestParams(request);
RegisterResultType result = xkmsService.register(request);
Assert.assertEquals(ResultMajorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_SENDER.value(), result.getResultMajor());
Assert.assertEquals(ResultMinorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_FAILURE.value(), result.getResultMinor());
}
use of org.apache.cxf.xkms.model.xkms.RegisterResultType in project cxf by apache.
the class XKRSSDisableTest method testRegisterShouldBeDisabled.
@Test
public void testRegisterShouldBeDisabled() {
RegisterRequestType request = new RegisterRequestType();
request.setService(XKMSConstants.XKMS_ENDPOINT_NAME);
request.setId(UUID.randomUUID().toString());
RegisterResultType result = xkmsService.register(request);
Assert.assertEquals(ResultMajorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_SENDER.value(), result.getResultMajor());
Assert.assertEquals(ResultMinorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_MESSAGE_NOT_SUPPORTED.value(), result.getResultMinor());
ResultDetails message = (ResultDetails) result.getMessageExtension().get(0);
Assert.assertEquals("XKRSS Operations are disabled", message.getDetails());
}
use of org.apache.cxf.xkms.model.xkms.RegisterResultType in project cxf by apache.
the class XKMSService method register.
@Override
public RegisterResultType register(RegisterRequestType request) {
RegisterResultType response = XKMSResponseFactory.createResponse(request, new RegisterResultType());
try {
assertXKRSSAllowed();
validateRequest(request);
for (Register handler : keyRegisterHandlers) {
if (handler.canProcess(request)) {
return handler.register(request, response);
}
}
throw new UnsupportedOperationException("Service was unable to handle your request");
} catch (Exception e) {
return handleException("register", e, response);
}
}
use of org.apache.cxf.xkms.model.xkms.RegisterResultType in project cxf by apache.
the class CheckXKRSS method checkRegisterWithoutXKRSS.
@Test
public void checkRegisterWithoutXKRSS() {
RegisterRequestType request = new RegisterRequestType();
request.setId("1");
request.setService(XKMSConstants.XKMS_ENDPOINT_NAME);
createXKMSService(false).register(request);
RegisterResultType result = createXKMSService(false).register(request);
assertNotSupported(result);
}
use of org.apache.cxf.xkms.model.xkms.RegisterResultType in project cxf by apache.
the class XKMSServiceTest method testRegisterWithoutKey.
@Test
public void testRegisterWithoutKey() throws URISyntaxException, Exception {
RegisterRequestType request = new RegisterRequestType();
setGenericRequestParams(request);
PrototypeKeyBindingType binding = new PrototypeKeyBindingType();
KeyInfoType keyInfo = new KeyInfoType();
binding.setKeyInfo(keyInfo);
request.setPrototypeKeyBinding(binding);
RegisterResultType result = xkmsService.register(request);
Assert.assertEquals(ResultMajorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_SENDER.value(), result.getResultMajor());
Assert.assertEquals(ResultMinorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_FAILURE.value(), result.getResultMinor());
}
Aggregations