Search in sources :

Example 1 with ClientAbstractAuthorizationDroolsConfiguration

use of gov.ca.cwds.authorizer.drools.configuration.ClientAbstractAuthorizationDroolsConfiguration in project api-core by ca-cwds.

the class ClientAuthorizationDrlTest method assertClientAccessMatrixValue.

private void assertClientAccessMatrixValue(ClientCondition condition, List<StaffPrivilegeType> privileges, boolean expectedResult) throws DroolsException {
    ClientAbstractAuthorizationDroolsConfiguration droolsConfiguration = new ClientAbstractAuthorizationDroolsConfiguration();
    List instances = new ArrayList<>();
    instances.add(condition);
    final boolean actualResult = droolsAuthorizationService.authorizeObjectOperation(privileges, droolsConfiguration, instances);
    assertThat(actualResult, is(expectedResult));
}
Also used : ArrayList(java.util.ArrayList) Collections.singletonList(java.util.Collections.singletonList) ArrayList(java.util.ArrayList) Collections.emptyList(java.util.Collections.emptyList) List(java.util.List) ClientAbstractAuthorizationDroolsConfiguration(gov.ca.cwds.authorizer.drools.configuration.ClientAbstractAuthorizationDroolsConfiguration)

Example 2 with ClientAbstractAuthorizationDroolsConfiguration

use of gov.ca.cwds.authorizer.drools.configuration.ClientAbstractAuthorizationDroolsConfiguration in project api-core by ca-cwds.

the class ClientAbstractReadAuthorizerTest method init.

@Before
public void init() {
    MockitoAnnotations.initMocks(this);
    final DroolsService droolsService = new DroolsService();
    final DroolsAuthorizationService droolsAuthorizationService = new DroolsAuthorizationService(droolsService);
    final ClientAbstractAuthorizationDroolsConfiguration droolsConfiguration = new ClientAbstractAuthorizationDroolsConfiguration();
    testSubject = new ClientAbstractReadAuthorizer(droolsAuthorizationService, droolsConfiguration);
    testSubject.setSensitivityDeterminationService(clientSensitivityDeterminationService);
    testSubject.setCountyDeterminationService(clientCountyDeterminationService);
}
Also used : DroolsAuthorizationService(gov.ca.cwds.authorizer.drools.DroolsAuthorizationService) DroolsService(gov.ca.cwds.drools.DroolsService) ClientAbstractAuthorizationDroolsConfiguration(gov.ca.cwds.authorizer.drools.configuration.ClientAbstractAuthorizationDroolsConfiguration) Before(org.junit.Before)

Aggregations

ClientAbstractAuthorizationDroolsConfiguration (gov.ca.cwds.authorizer.drools.configuration.ClientAbstractAuthorizationDroolsConfiguration)2 DroolsAuthorizationService (gov.ca.cwds.authorizer.drools.DroolsAuthorizationService)1 DroolsService (gov.ca.cwds.drools.DroolsService)1 ArrayList (java.util.ArrayList)1 Collections.emptyList (java.util.Collections.emptyList)1 Collections.singletonList (java.util.Collections.singletonList)1 List (java.util.List)1 Before (org.junit.Before)1