when(accountStore.getAccount(ROBOT_ID)).thenReturn(accountData);
AccountData unregisteredAccountData = registrar.registerOrUpdate(ROBOT_ID, OTHER_LOCATION);
verify(accountStore).removeAccount(ROBOT_ID);
verify(accountStore).putAccount(any(RobotAccountData.class));
assertTrue(unregisteredAccountData.isRobot());
RobotAccountData robotAccountData = unregisteredAccountData.asRobot();
// Remove the last '/'.
assertEquals(OTHER_LOCATION.substring(0, OTHER_LOCATION.length() - 1),
robotAccountData.getUrl());
assertEquals(ROBOT_ID, robotAccountData.getId());
assertEquals(CONSUMER_TOKEN, robotAccountData.getConsumerSecret());