### Question:
CTSOperations implements SessionOperations { public void setProperty(Session session, String name, String value) throws SessionException { remote.setProperty(session, name, value); } @Inject  CTSOperations(CTSPersistentStore cts, SessionAdapter adapter,
                         TokenIdFactory idFactory, SessionInfoFactory sessionInfoFactory,
                         SessionService sessionService, RemoteOperations remote,
                         @Named(SessionConstants.SESSION_DEBUG) Debug debug); SessionInfo refresh(Session session, boolean reset); void logout(Session session); @Override void destroy(Session requester, Session session); void setProperty(Session session, String name, String value);  }### Answer:
@Test public void shouldInvokeRemoteActionDuringSetProperty() throws SessionException, CoreTokenException { String name = "name"; String value = "value"; SessionID mockSessionID = mock(SessionID.class); given(mockSession.getID()).willReturn(mockSessionID); Token mockToken = mock(Token.class); given(mockCTS.read(anyString())).willReturn(mockToken); InternalSession mockInternalSession = mock(InternalSession.class); given(mockAdapter.fromToken(eq(mockToken))).willReturn(mockInternalSession); ctsOperations.setProperty(mockSession, name, value); verify(mockRemote).setProperty(mockSession, name, value); }
@Test public void shouldCallRemoteSetPropertyDuringSetProperty() throws SessionException { SessionID mockSessionID = mock(SessionID.class); given(mockSession.getID()).willReturn(mockSessionID); ctsOperations.setProperty(mockSession, "a", "b"); verify(mockRemote).setProperty(mockSession, "a", "b"); }