@Override public void destroyObject(Session<I, R> session) throws Exception { session.destroy(); }
@Test() public void fromDestroyed() throws IllegalArgumentException, IllegalAccessException { stateField.set(session, State.DESTROYED); session.destroy(); assertThat(session.getState(), equalTo(Session.State.DESTROYED)); verifyNoMoreInteractions(sessionContext); }
@Test(dataProvider = "destroyableStates") public void testFromDestroyableStates(State state) throws IllegalArgumentException, IllegalAccessException { stateField.set(session, state); session.destroy(); assertThat(session.getState(), equalTo(Session.State.DESTROYED)); } }
@Test() public void fromProcessed() throws IllegalArgumentException, IllegalAccessException { stateField.set(session, State.PROCESSED); session.destroy(); assertThat(session.getState(), equalTo(Session.State.DESTROYED)); verify(sessionContext, times(1)).passivate(); }