Search in sources :

Example 1 with TokenOperationsStore

use of org.forgerock.openam.cts.monitoring.impl.operations.TokenOperationsStore in project OpenAM by OpenRock.

the class CTSMonitoringStoreImplTest method setUp.

@BeforeMethod
public void setUp() {
    tokenOperationsStore = mock(TokenOperationsStore.class);
    final ExecutorService executorService = mock(ExecutorService.class);
    final Debug debug = mock(Debug.class);
    reaperMonitor = mock(ReaperMonitor.class);
    connectionStore = mock(ConnectionStore.class);
    ctsOperationsMonitoringStore = new CTSMonitoringStoreImpl(executorService, tokenOperationsStore, reaperMonitor, connectionStore, debug);
    ctsReaperMonitoringStore = (CTSReaperMonitoringStore) ctsOperationsMonitoringStore;
    given(executorService.submit(any(Callable.class))).will(new Answer<Object>() {

        public Object answer(InvocationOnMock invocation) throws Throwable {
            Callable r = (Callable) invocation.getArguments()[0];
            r.call();
            return null;
        }
    });
}
Also used : InvocationOnMock(org.mockito.invocation.InvocationOnMock) ExecutorService(java.util.concurrent.ExecutorService) CTSMonitoringStoreImpl(org.forgerock.openam.cts.monitoring.impl.CTSMonitoringStoreImpl) TokenOperationsStore(org.forgerock.openam.cts.monitoring.impl.operations.TokenOperationsStore) ConnectionStore(org.forgerock.openam.cts.monitoring.impl.connections.ConnectionStore) ReaperMonitor(org.forgerock.openam.cts.monitoring.impl.reaper.ReaperMonitor) Debug(com.sun.identity.shared.debug.Debug) Callable(java.util.concurrent.Callable) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

Debug (com.sun.identity.shared.debug.Debug)1 Callable (java.util.concurrent.Callable)1 ExecutorService (java.util.concurrent.ExecutorService)1 CTSMonitoringStoreImpl (org.forgerock.openam.cts.monitoring.impl.CTSMonitoringStoreImpl)1 ConnectionStore (org.forgerock.openam.cts.monitoring.impl.connections.ConnectionStore)1 TokenOperationsStore (org.forgerock.openam.cts.monitoring.impl.operations.TokenOperationsStore)1 ReaperMonitor (org.forgerock.openam.cts.monitoring.impl.reaper.ReaperMonitor)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1 BeforeMethod (org.testng.annotations.BeforeMethod)1