Search in sources :

Example 56 with Holder

use of javax.xml.ws.Holder in project midpoint by Evolveum.

the class TestWSSecurity method test134GetConfigAsDarthAdderGoodPasswordDigest.

@Test
public void test134GetConfigAsDarthAdderGoodPasswordDigest() throws Exception {
    final String TEST_NAME = "test134GetConfigAsDarthAdderGoodPasswordDigest";
    displayTestTitle(TEST_NAME);
    LogfileTestTailer tailer = createLogTailer();
    modelPort = createModelPort(USER_DARTHADDER_USERNAME, USER_DARTHADDER_PASSWORD, WSConstants.PW_DIGEST);
    Holder<ObjectType> objectHolder = new Holder<ObjectType>();
    Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
    /// WHEN
    modelPort.getObject(getTypeQName(SystemConfigurationType.class), SystemObjectsType.SYSTEM_CONFIGURATION.value(), null, objectHolder, resultHolder);
    // THEN
    assertSuccess(resultHolder);
    tailer.tail();
    assertAuditLoginLogout(tailer);
    assertAuditIds(tailer);
    tailer.assertAudit(2);
}
Also used : LogfileTestTailer(com.evolveum.midpoint.test.util.LogfileTestTailer) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) Holder(javax.xml.ws.Holder) SystemConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType) Test(org.testng.annotations.Test)

Example 57 with Holder

use of javax.xml.ws.Holder in project midpoint by Evolveum.

the class TestWSSecurity method test105GetConfigWrongUsernameDigest.

@Test
public void test105GetConfigWrongUsernameDigest() throws Exception {
    final String TEST_NAME = "test105GetConfigWrongUsernameDigest";
    displayTestTitle(TEST_NAME);
    LogfileTestTailer tailer = createLogTailer();
    modelPort = createModelPort("admin", USER_ADMINISTRATOR_PASSWORD, WSConstants.PW_DIGEST);
    Holder<ObjectType> objectHolder = new Holder<ObjectType>();
    Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
    // WHEN
    try {
        modelPort.getObject(getTypeQName(SystemConfigurationType.class), SystemObjectsType.SYSTEM_CONFIGURATION.value(), null, objectHolder, resultHolder);
        AssertJUnit.fail("Unexpected success");
    } catch (SOAPFaultException e) {
        assertSoapSecurityFault(e, "FailedAuthentication", "could not be authenticated or authorized");
    }
    tailer.tail();
    assertAuditLoginFailed(tailer, "no user");
}
Also used : LogfileTestTailer(com.evolveum.midpoint.test.util.LogfileTestTailer) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) Holder(javax.xml.ws.Holder) SystemConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) Test(org.testng.annotations.Test)

Example 58 with Holder

use of javax.xml.ws.Holder in project midpoint by Evolveum.

the class TestWSSecurity method test104GetConfigEmptyPasswordText.

@Test
public void test104GetConfigEmptyPasswordText() throws Exception {
    final String TEST_NAME = "test104GetConfigEmptyPasswordText";
    displayTestTitle(TEST_NAME);
    LogfileTestTailer tailer = createLogTailer();
    modelPort = createModelPort(USER_ADMINISTRATOR_USERNAME, "", WSConstants.PW_TEXT);
    Holder<ObjectType> objectHolder = new Holder<ObjectType>();
    Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
    // WHEN
    try {
        modelPort.getObject(getTypeQName(SystemConfigurationType.class), SystemObjectsType.SYSTEM_CONFIGURATION.value(), null, objectHolder, resultHolder);
        AssertJUnit.fail("Unexpected success");
    } catch (SOAPFaultException e) {
        assertSoapSecurityFault(e, "FailedAuthentication", "could not be authenticated or authorized");
    }
    tailer.tail();
    assertAuditLoginFailed(tailer, "could not be authenticated or authorized");
}
Also used : LogfileTestTailer(com.evolveum.midpoint.test.util.LogfileTestTailer) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) Holder(javax.xml.ws.Holder) SystemConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) Test(org.testng.annotations.Test)

Example 59 with Holder

use of javax.xml.ws.Holder in project midpoint by Evolveum.

the class TestWSSecurity method test110GetConfigGoodPasswordDigest.

@Test
public void test110GetConfigGoodPasswordDigest() throws Exception {
    final String TEST_NAME = "test110GetConfigGoodPasswordDigest";
    displayTestTitle(TEST_NAME);
    LogfileTestTailer tailer = createLogTailer();
    modelPort = createModelPort(USER_ADMINISTRATOR_USERNAME, USER_ADMINISTRATOR_PASSWORD, WSConstants.PW_DIGEST);
    Holder<ObjectType> objectHolder = new Holder<ObjectType>();
    Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
    // WHEN
    modelPort.getObject(getTypeQName(SystemConfigurationType.class), SystemObjectsType.SYSTEM_CONFIGURATION.value(), null, objectHolder, resultHolder);
    tailer.tail();
    assertAuditLoginLogout(tailer);
    assertAuditIds(tailer);
    tailer.assertAudit(2);
}
Also used : LogfileTestTailer(com.evolveum.midpoint.test.util.LogfileTestTailer) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) Holder(javax.xml.ws.Holder) SystemConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType) Test(org.testng.annotations.Test)

Example 60 with Holder

use of javax.xml.ws.Holder in project midpoint by Evolveum.

the class TestWSSecurity method test131GetConfigAsCyclopsGoodPasswordDigest.

@Test
public void test131GetConfigAsCyclopsGoodPasswordDigest() throws Exception {
    final String TEST_NAME = "test131GetConfigAsCyclopsGoodPasswordDigest";
    displayTestTitle(TEST_NAME);
    modelPort = createModelPort(USER_CYCLOPS_USERNAME, USER_CYCLOPS_PASSWORD, WSConstants.PW_DIGEST);
    Holder<ObjectType> objectHolder = new Holder<ObjectType>();
    Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
    LogfileTestTailer tailer = createLogTailer();
    // WHEN
    try {
        modelPort.getObject(getTypeQName(SystemConfigurationType.class), SystemObjectsType.SYSTEM_CONFIGURATION.value(), null, objectHolder, resultHolder);
        AssertJUnit.fail("Unexpected success");
    } catch (SOAPFaultException e) {
        assertSoapFault(e, "FailedAuthentication", "could not be authenticated or authorized");
    }
    tailer.tail();
    assertAuditLoginLogout(tailer);
}
Also used : LogfileTestTailer(com.evolveum.midpoint.test.util.LogfileTestTailer) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) Holder(javax.xml.ws.Holder) SystemConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) Test(org.testng.annotations.Test)

Aggregations

Holder (javax.xml.ws.Holder)328 Test (org.junit.Test)204 OperationResultType (com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType)77 Test (org.testng.annotations.Test)53 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)48 BigInteger (java.math.BigInteger)44 SelectorQualifiedGetOptionsType (com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionsType)33 AbstractModelIntegrationTest (com.evolveum.midpoint.model.test.AbstractModelIntegrationTest)29 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)29 QName (javax.xml.namespace.QName)29 PrismAsserts.assertEqualsPolyString (com.evolveum.midpoint.prism.util.PrismAsserts.assertEqualsPolyString)24 ObjectListType (com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectListType)23 SystemConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType)23 URL (java.net.URL)23 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)21 LogfileTestTailer (com.evolveum.midpoint.test.util.LogfileTestTailer)21 SOAPFaultException (javax.xml.ws.soap.SOAPFaultException)21 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)19 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)16 GenericObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.GenericObjectType)15