public void testUnbindingIsIsolated() { if (!isMultiSession()) { return; } final MockActivatable mock1 = storeNewMock(); db().commit(); final MockActivatable mock2 = retrieveMockFromNewClientAndClose(); assertBindUnbindCalls(mock2); // mock1 has only be bound by store so far // client.close should have no effect on it mock1 .recorder() .verify( new MethodCall( "bind", new MethodCall.ArgumentCondition() { public void verify(Object argument) { Assert.isNotNull(argument); } })); }
private void assertSingleBindCall(final MockActivatable mock) { mock.recorder().verify(new MethodCall("bind", MethodCall.IGNORED_ARGUMENT)); }
private void assertBindUnbindCalls(final MockActivatable mock) { mock.recorder() .verify( new MethodCall("bind", MethodCall.IGNORED_ARGUMENT), new MethodCall("bind", new Object[] {null})); }