public void testExceptionOnMissingHash() throws Exception { OperationRequest operation = new OperationRequest("robot.notify", OP_ID); try { operationService.execute(operation, context, ROBOT); fail("Expected InvalidRequestException"); } catch (InvalidRequestException e) { // expected } verifyZeroInteractions(connector); verify(accountStore, never()).putAccount(any(AccountData.class)); } }
public void testExceptionOnMissingHash() throws Exception { OperationRequest operation = new OperationRequest("robot.notify", OP_ID); try { operationService.execute(operation, context, ROBOT); fail("Expected InvalidRequestException"); } catch (InvalidRequestException e) { // expected } verifyZeroInteractions(connector); verify(accountStore, never()).putAccount(any(AccountData.class)); } }
public void testExceptionOnUnknownAccount() throws Exception { OperationRequest operation = new OperationRequest("robot.notify", OP_ID, Parameter.of(ParamsProperty.CAPABILITIES_HASH, NEW_HASH)); when(accountStore.getAccount(ROBOT)).thenReturn(null); try { operationService.execute(operation, context, ROBOT); fail("Expected InvalidRequestException"); } catch (InvalidRequestException e) { // expected } verifyZeroInteractions(connector); verify(accountStore, never()).putAccount(any(AccountData.class)); }
public void testExceptionOnUnknownAccount() throws Exception { OperationRequest operation = new OperationRequest("robot.notify", OP_ID, Parameter.of(ParamsProperty.CAPABILITIES_HASH, NEW_HASH)); when(accountStore.getAccount(ROBOT)).thenReturn(null); try { operationService.execute(operation, context, ROBOT); fail("Expected InvalidRequestException"); } catch (InvalidRequestException e) { // expected } verifyZeroInteractions(connector); verify(accountStore, never()).putAccount(any(AccountData.class)); }