@Test
public void Should_registerUpCounterCallback()
        throws Exception {

    IObject args = IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.iobject.IObject"),
            ("{" +
                    "'connectionOptionsDependency':'the connection options'," +
                    "'connectionPoolDependency':'the connection pool'," +
                    "'collectionName':'" + collectionName + "'" +
                    "}").replace('\'','"'));
    CheckpointActor actor = new CheckpointActor(args);
    ArgumentCaptor<IAction> callbackCaptor = ArgumentCaptor.forClass(IAction.class);
    verify(upCounterMock).onShutdownRequest(callbackCaptor.capture());
    callbackCaptor.getValue().execute(null);
    verify(serviceMock).stop();
    doThrow(ServiceStopException.class).when(serviceMock).stop();
    try {
        callbackCaptor.getValue().execute(null);
        fail();
    } catch (ActionExecuteException ignore) { }
    doThrow(IllegalServiceStateException.class).when(serviceMock).stop();
    callbackCaptor.getValue().execute(null);
}