41424344454647484950
when(identity.getCredentials()).thenReturn(new ZanataCredentials()); } @Test public void testExecute() throws Exception { handler.execute(new RemoteLoggingAction("blah"), null); verify(identity).checkLoggedIn(); verify(identity).getCredentials(); }
535455565758596061
public void testExecuteWithoutLoggedIn() throws Exception { doThrow(new RuntimeException("not logged in")).when(identity) .checkLoggedIn(); NoOpResult result = handler.execute(new RemoteLoggingAction("blah"), null); assertThat(result, Matchers.notNullValue()); }
6061626364656667
assertThat(result, Matchers.notNullValue()); } @Test public void testRollback() throws Exception { handler.rollback(new RemoteLoggingAction("blow"), new NoOpResult(), null); }