Search in sources :

Example 26 with PilotUser

use of com.sanction.thunder.models.PilotUser in project thunder by RohanNagar.

the class UsersDaoTest method testSuccessfulUpdate.

@Test
public void testSuccessfulUpdate() {
    when(table.getItem(anyString(), anyString())).thenReturn(item);
    PilotUser result = usersDao.update(null, user);
    verify(table, times(1)).getItem(anyString(), anyString());
    verify(table, times(1)).putItem(any(Item.class), any(Expected.class));
    assertEquals(user, result);
}
Also used : Item(com.amazonaws.services.dynamodbv2.document.Item) Expected(com.amazonaws.services.dynamodbv2.document.Expected) PilotUser(com.sanction.thunder.models.PilotUser) Test(org.junit.Test)

Aggregations

PilotUser (com.sanction.thunder.models.PilotUser)26 Test (org.junit.Test)20 Response (javax.ws.rs.core.Response)9 DatabaseException (com.sanction.thunder.dao.DatabaseException)6 Email (com.sanction.thunder.models.Email)4 Expected (com.amazonaws.services.dynamodbv2.document.Expected)3 Item (com.amazonaws.services.dynamodbv2.document.Item)3 DeleteItemSpec (com.amazonaws.services.dynamodbv2.document.spec.DeleteItemSpec)2 GET (javax.ws.rs.GET)2 POST (javax.ws.rs.POST)2 URI (java.net.URI)1 StringJoiner (java.util.StringJoiner)1 DELETE (javax.ws.rs.DELETE)1 PUT (javax.ws.rs.PUT)1