Search in sources :

Example 1 with WSAPIKeyDataStore

use of org.wso2.carbon.apimgt.gateway.handlers.security.keys.WSAPIKeyDataStore in project carbon-apimgt by wso2.

the class APIKeyValidatorTestCase method testDatasourceConfigurationAndCleanup.

@Test
public void testDatasourceConfigurationAndCleanup() throws Exception {
    AxisConfiguration axisConfig = Mockito.mock(AxisConfiguration.class);
    WSAPIKeyDataStore wsDataStore = Mockito.mock(WSAPIKeyDataStore.class);
    PowerMockito.whenNew(WSAPIKeyDataStore.class).withNoArguments().thenReturn(wsDataStore);
    APIKeyValidator wsKeyValidator = new APIKeyValidator() {
    };
    // test cleanup for WSClient
    wsKeyValidator.cleanup();
    Mockito.verify(wsDataStore, Mockito.times(1)).cleanup();
}
Also used : AxisConfiguration(org.apache.axis2.engine.AxisConfiguration) WSAPIKeyDataStore(org.wso2.carbon.apimgt.gateway.handlers.security.keys.WSAPIKeyDataStore) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

AxisConfiguration (org.apache.axis2.engine.AxisConfiguration)1 Test (org.junit.Test)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1 WSAPIKeyDataStore (org.wso2.carbon.apimgt.gateway.handlers.security.keys.WSAPIKeyDataStore)1