Search in sources :

Example 11 with RequestType

use of com.helger.peppol.wsclient2.RequestType in project UVMS-Docker by UnionVMS.

the class FluxMessageReceiverBeanIT method postRequestTypeEmptyRequestFailureTest.

/**
 * Post request type empty request failure test.
 */
@Test
public void postRequestTypeEmptyRequestFailureTest() {
    BridgeConnectorPortType bridgeConnectorPortType = createBridgeConnector();
    RequestType requestType = new RequestType();
    ResponseType responseType = bridgeConnectorPortType.post(requestType);
    assertNotNull(responseType);
    assertEquals("NOK", responseType.getStatus());
}
Also used : BridgeConnectorPortType(xeu.bridge_connector.wsdl.v1.BridgeConnectorPortType) RequestType(xeu.bridge_connector.v1.RequestType) ResponseType(xeu.bridge_connector.v1.ResponseType) Test(org.junit.Test) AbstractRestServiceTest(eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)

Example 12 with RequestType

use of com.helger.peppol.wsclient2.RequestType in project ddf by codice.

the class XacmlPdpTest method testSameAccessRedaction.

@Test
public void testSameAccessRedaction() throws PdpException {
    HashMap<String, List<String>> security = new HashMap<String, List<String>>();
    security.put(RESOURCE_ACCESS, Arrays.asList(ACCESS_TYPE_A, ACCESS_TYPE_B));
    KeyValueCollectionPermission resourcePermissions = new KeyValueCollectionPermissionImpl(CollectionPermission.READ_ACTION, security);
    RequestType request = testRealm.createXACMLRequest(USER_NAME, generateSubjectInfo(TEST_COUNTRY), resourcePermissions);
    assertThat(testRealm.isPermitted(request), equalTo(true));
}
Also used : KeyValueCollectionPermission(ddf.security.permission.KeyValueCollectionPermission) HashMap(java.util.HashMap) KeyValueCollectionPermissionImpl(ddf.security.permission.impl.KeyValueCollectionPermissionImpl) ArrayList(java.util.ArrayList) List(java.util.List) RequestType(oasis.names.tc.xacml._3_0.core.schema.wd_17.RequestType) Test(org.junit.Test)

Example 13 with RequestType

use of com.helger.peppol.wsclient2.RequestType in project ddf by codice.

the class XacmlPdpTest method testActionGoodSiteName.

@Test
public void testActionGoodSiteName() {
    SimpleAuthorizationInfo blankUserInfo = new SimpleAuthorizationInfo(new HashSet<String>());
    blankUserInfo.setObjectPermissions(new HashSet<Permission>());
    RequestType request = testRealm.createXACMLRequest(USER_NAME, blankUserInfo, new KeyValueCollectionPermissionImpl(SITE_NAME_ACTION));
    assertThat(testRealm.isPermitted(request), equalTo(true));
}
Also used : SimpleAuthorizationInfo(org.apache.shiro.authz.SimpleAuthorizationInfo) CollectionPermission(ddf.security.permission.CollectionPermission) KeyValuePermission(ddf.security.permission.KeyValuePermission) Permission(org.apache.shiro.authz.Permission) KeyValueCollectionPermission(ddf.security.permission.KeyValueCollectionPermission) KeyValueCollectionPermissionImpl(ddf.security.permission.impl.KeyValueCollectionPermissionImpl) RequestType(oasis.names.tc.xacml._3_0.core.schema.wd_17.RequestType) Test(org.junit.Test)

Example 14 with RequestType

use of com.helger.peppol.wsclient2.RequestType in project ddf by codice.

the class XacmlPdpTest method testActionGoodCountry.

@Test
public void testActionGoodCountry() {
    RequestType request = testRealm.createXACMLRequest(USER_NAME, generateSubjectInfo(TEST_COUNTRY), new KeyValueCollectionPermissionImpl(QUERY_ACTION));
    assertThat(testRealm.isPermitted(request), equalTo(true));
}
Also used : KeyValueCollectionPermissionImpl(ddf.security.permission.impl.KeyValueCollectionPermissionImpl) RequestType(oasis.names.tc.xacml._3_0.core.schema.wd_17.RequestType) Test(org.junit.Test)

Example 15 with RequestType

use of com.helger.peppol.wsclient2.RequestType in project ddf by codice.

the class XacmlPdpTest method testResourceIsPermitted.

@Test
public void testResourceIsPermitted() {
    HashMap<String, List<String>> security = new HashMap<String, List<String>>();
    security.put(RESOURCE_ACCESS, Arrays.asList(ACCESS_TYPE_A));
    KeyValueCollectionPermission resourcePermissions = new KeyValueCollectionPermissionImpl(CollectionPermission.READ_ACTION, security);
    RequestType request = testRealm.createXACMLRequest(USER_NAME, generateSubjectInfo(TEST_COUNTRY), resourcePermissions);
    assertThat(testRealm.isPermitted(request), equalTo(true));
}
Also used : KeyValueCollectionPermission(ddf.security.permission.KeyValueCollectionPermission) HashMap(java.util.HashMap) KeyValueCollectionPermissionImpl(ddf.security.permission.impl.KeyValueCollectionPermissionImpl) ArrayList(java.util.ArrayList) List(java.util.List) RequestType(oasis.names.tc.xacml._3_0.core.schema.wd_17.RequestType) Test(org.junit.Test)

Aggregations

RequestType (oasis.names.tc.xacml._3_0.core.schema.wd_17.RequestType)14 Test (org.junit.Test)14 KeyValueCollectionPermissionImpl (ddf.security.permission.impl.KeyValueCollectionPermissionImpl)8 AttributesType (oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributesType)6 KeyValueCollectionPermission (ddf.security.permission.KeyValueCollectionPermission)5 AttributeType (oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeType)5 AttributeValueType (oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType)5 SecurityLogger (ddf.security.audit.SecurityLogger)4 ArrayList (java.util.ArrayList)4 List (java.util.List)4 File (java.io.File)3 StringWriter (java.io.StringWriter)3 Writer (java.io.Writer)3 ItemType (com.helger.peppol.wsclient2.ItemType)2 ResponseType (com.helger.peppol.wsclient2.ResponseType)2 ValidationResultType (com.helger.peppol.wsclient2.ValidationResultType)2 KeyValuePermission (ddf.security.permission.KeyValuePermission)2 AbstractRestServiceTest (eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)2 HashMap (java.util.HashMap)2 JAXBContext (javax.xml.bind.JAXBContext)2