Search in sources :

Example 1 with AuthorizationMessageUtilsService

use of com.sequenceiq.authorization.utils.AuthorizationMessageUtilsService in project cloudbreak by hortonworks.

the class UmsResourceAuthorizationServiceTest method init.

@BeforeEach
public void init() throws IllegalAccessException {
    when(resourceNameFactoryService.getNames(any())).thenReturn(Collections.EMPTY_MAP);
    this.authorizationMessageUtilsService = spy(new AuthorizationMessageUtilsService(resourceNameFactoryService));
    FieldUtils.writeField(underTest, "authorizationMessageUtilsService", authorizationMessageUtilsService, true);
    when(umsRightProvider.getRight(any())).thenAnswer(invocation -> {
        AuthorizationResourceAction action = invocation.getArgument(0);
        return action.getRight();
    });
}
Also used : AuthorizationMessageUtilsService(com.sequenceiq.authorization.utils.AuthorizationMessageUtilsService) AuthorizationResourceAction(com.sequenceiq.authorization.resource.AuthorizationResourceAction) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

AuthorizationResourceAction (com.sequenceiq.authorization.resource.AuthorizationResourceAction)1 AuthorizationMessageUtilsService (com.sequenceiq.authorization.utils.AuthorizationMessageUtilsService)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1