use of com.sanction.thunder.models.PilotUser in project thunder by RohanNagar.
the class UserResourceTest method testUpdateUserInvalidEmail.
@Test
public void testUpdateUserInvalidEmail() {
PilotUser user = new PilotUser(badEmail, "password", "", "", "");
Response response = resource.updateUser(key, "password", email.getAddress(), user);
assertEquals(Response.Status.BAD_REQUEST, response.getStatusInfo());
}
use of com.sanction.thunder.models.PilotUser in project thunder by RohanNagar.
the class ThunderClientTest method testDeleteUser.
@Test
@SuppressWarnings("ConstantConditions")
public void testDeleteUser() throws IOException {
PilotUser response = client.deleteUser("email", password).execute().body();
assertEquals(user.getEmail(), response.getEmail());
}
use of com.sanction.thunder.models.PilotUser in project thunder by RohanNagar.
the class ThunderClientTest method testVerifyUser.
@Test
@SuppressWarnings("ConstantConditions")
public void testVerifyUser() throws IOException {
PilotUser response = client.verifyUser("email", "token").execute().body();
assertEquals(user.getEmail(), response.getEmail());
}
use of com.sanction.thunder.models.PilotUser in project thunder by RohanNagar.
the class UsersDaoTest method testSuccessfulEmailUpdate.
@Test
public void testSuccessfulEmailUpdate() {
when(table.getItem(anyString(), anyString())).thenReturn(item);
PilotUser result = usersDao.update("existingEmail", user);
assertEquals(user, result);
verify(table, times(1)).getItem(anyString(), anyString());
verify(table, times(1)).deleteItem(any(DeleteItemSpec.class));
verify(table, times(1)).putItem(any(Item.class), any(Expected.class));
}
use of com.sanction.thunder.models.PilotUser in project thunder by RohanNagar.
the class UsersDaoTest method testSuccessfulDelete.
@Test
public void testSuccessfulDelete() {
when(table.getItem(anyString(), anyString())).thenReturn(item);
PilotUser result = usersDao.delete("email");
verify(table, times(1)).getItem(anyString(), anyString());
verify(table, times(1)).deleteItem(any(DeleteItemSpec.class));
assertEquals(user, result);
}
Aggregations