public void testUnregisterNonExistingRobot() throws PersistenceException, RobotRegistrationException { AccountData unregisteredAccountData = registrar.unregister(ROBOT_ID); assertNull(unregisteredAccountData); }
public void testUnregisterNonExistingRobot() throws PersistenceException, RobotRegistrationException { AccountData unregisteredAccountData = registrar.unregister(ROBOT_ID); assertNull(unregisteredAccountData); }
public void testUnregisterSucceeds() throws PersistenceException, RobotRegistrationException { when(accountStore.getAccount(ROBOT_ID)).thenReturn(accountData); AccountData unregisteredAccountData = registrar.unregister(ROBOT_ID); assertTrue(unregisteredAccountData.equals(accountData)); verify(accountData).isRobot(); verify(accountStore).removeAccount(ROBOT_ID); }
public void testUnregisterSucceeds() throws PersistenceException, RobotRegistrationException { when(accountStore.getAccount(ROBOT_ID)).thenReturn(accountData); AccountData unregisteredAccountData = registrar.unregister(ROBOT_ID); assertTrue(unregisteredAccountData.equals(accountData)); verify(accountData).isRobot(); verify(accountStore).removeAccount(ROBOT_ID); }
public void testUnregisterFailsOnHumanAccount() throws PersistenceException { when(accountStore.getAccount(HUMAN_ID)).thenReturn( new HumanAccountDataImpl(ParticipantId.ofUnsafe(HUMAN_ID.getAddress()))); try { registrar.unregister(HUMAN_ID); fail(); } catch (RobotRegistrationException e) { // Expected. } }
public void testUnregisterFailsOnHumanAccount() throws PersistenceException { when(accountStore.getAccount(HUMAN_ID)).thenReturn( new HumanAccountDataImpl(ParticipantId.ofUnsafe(HUMAN_ID.getAddress()))); try { registrar.unregister(HUMAN_ID); fail(); } catch (RobotRegistrationException e) { // Expected. } }