Search in sources :

Example 1 with RegisterRequestType

use of org.apache.cxf.xkms.model.xkms.RegisterRequestType 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());
}
Also used : RegisterResultType(org.apache.cxf.xkms.model.xkms.RegisterResultType) RegisterRequestType(org.apache.cxf.xkms.model.xkms.RegisterRequestType) BasicIntegrationTest(org.apache.cxf.xkms.itests.BasicIntegrationTest) Test(org.junit.Test)

Example 2 with RegisterRequestType

use of org.apache.cxf.xkms.model.xkms.RegisterRequestType 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());
}
Also used : ResultDetails(org.apache.cxf.xkms.model.extensions.ResultDetails) RegisterResultType(org.apache.cxf.xkms.model.xkms.RegisterResultType) RegisterRequestType(org.apache.cxf.xkms.model.xkms.RegisterRequestType) BasicIntegrationTest(org.apache.cxf.xkms.itests.BasicIntegrationTest) Test(org.junit.Test)

Example 3 with RegisterRequestType

use of org.apache.cxf.xkms.model.xkms.RegisterRequestType 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);
}
Also used : RegisterResultType(org.apache.cxf.xkms.model.xkms.RegisterResultType) RegisterRequestType(org.apache.cxf.xkms.model.xkms.RegisterRequestType) Test(org.junit.Test)

Example 4 with RegisterRequestType

use of org.apache.cxf.xkms.model.xkms.RegisterRequestType in project cxf by apache.

the class CheckXKRSS method checkRevokeWithXKRSS.

@Test
public void checkRevokeWithXKRSS() {
    RegisterRequestType request = new RegisterRequestType();
    request.setId("1");
    request.setService(XKMSConstants.XKMS_ENDPOINT_NAME);
    ResultType result = createXKMSService(true).register(request);
    assertSuccess(result);
}
Also used : RegisterRequestType(org.apache.cxf.xkms.model.xkms.RegisterRequestType) RecoverResultType(org.apache.cxf.xkms.model.xkms.RecoverResultType) ResultType(org.apache.cxf.xkms.model.xkms.ResultType) ReissueResultType(org.apache.cxf.xkms.model.xkms.ReissueResultType) RevokeResultType(org.apache.cxf.xkms.model.xkms.RevokeResultType) RegisterResultType(org.apache.cxf.xkms.model.xkms.RegisterResultType) Test(org.junit.Test)

Example 5 with RegisterRequestType

use of org.apache.cxf.xkms.model.xkms.RegisterRequestType 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());
}
Also used : RegisterResultType(org.apache.cxf.xkms.model.xkms.RegisterResultType) PrototypeKeyBindingType(org.apache.cxf.xkms.model.xkms.PrototypeKeyBindingType) RegisterRequestType(org.apache.cxf.xkms.model.xkms.RegisterRequestType) KeyInfoType(org.apache.cxf.xkms.model.xmldsig.KeyInfoType) BasicIntegrationTest(org.apache.cxf.xkms.itests.BasicIntegrationTest) Test(org.junit.Test)

Aggregations

RegisterRequestType (org.apache.cxf.xkms.model.xkms.RegisterRequestType)7 RegisterResultType (org.apache.cxf.xkms.model.xkms.RegisterResultType)7 Test (org.junit.Test)6 BasicIntegrationTest (org.apache.cxf.xkms.itests.BasicIntegrationTest)3 RecoverResultType (org.apache.cxf.xkms.model.xkms.RecoverResultType)2 ReissueResultType (org.apache.cxf.xkms.model.xkms.ReissueResultType)2 RevokeResultType (org.apache.cxf.xkms.model.xkms.RevokeResultType)2 ArrayList (java.util.ArrayList)1 Register (org.apache.cxf.xkms.handlers.Register)1 ResultDetails (org.apache.cxf.xkms.model.extensions.ResultDetails)1 PrototypeKeyBindingType (org.apache.cxf.xkms.model.xkms.PrototypeKeyBindingType)1 RecoverRequestType (org.apache.cxf.xkms.model.xkms.RecoverRequestType)1 ReissueRequestType (org.apache.cxf.xkms.model.xkms.ReissueRequestType)1 RequestAbstractType (org.apache.cxf.xkms.model.xkms.RequestAbstractType)1 ResultType (org.apache.cxf.xkms.model.xkms.ResultType)1 RevokeRequestType (org.apache.cxf.xkms.model.xkms.RevokeRequestType)1 KeyInfoType (org.apache.cxf.xkms.model.xmldsig.KeyInfoType)1