Search in sources :

Example 6 with StandaloneAuthorizationManagerClient

use of org.wso2.carbon.apimgt.impl.utils.StandaloneAuthorizationManagerClient in project carbon-apimgt by wso2.

the class StandaloneAuthorizationManagerClientTestCase method testGetRoleNamesException.

@Test(expected = APIManagementException.class)
public void testGetRoleNamesException() throws Exception {
    StandaloneAuthorizationManagerClient standaloneAuthorizationManagerClient = new StandaloneAuthorizationManagerClient();
    Mockito.when(userStoreManager.getRoleNames()).thenThrow(new UserStoreException());
    standaloneAuthorizationManagerClient.getRoleNames();
}
Also used : StandaloneAuthorizationManagerClient(org.wso2.carbon.apimgt.impl.utils.StandaloneAuthorizationManagerClient) UserStoreException(org.wso2.carbon.user.core.UserStoreException) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

Test (org.junit.Test)6 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)6 StandaloneAuthorizationManagerClient (org.wso2.carbon.apimgt.impl.utils.StandaloneAuthorizationManagerClient)6 UserStoreException (org.wso2.carbon.user.core.UserStoreException)3