Example #1
0
 @Test
 public void shouldInsertIntoDB() throws Exception {
   carpoolBuddyDao.insert(carpoolBuddy, carpool);
   assertThat(
       carpoolBuddyDao.getCarpoolBuddiesByCarpoolName(carpool.getName()).contains(carpoolBuddy),
       equalTo(true));
   carpoolBuddyDao.remove(carpoolBuddy.getBuddy().getUserName(), carpool.getName());
 }
Example #2
0
 @Test
 public void shouldGetCarpoolBuddyFormUserNameAndCarpoolName() throws Exception {
   carpoolBuddyDao.insert(carpoolBuddy, carpool);
   CarpoolBuddy carpoolBuddyActual =
       carpoolBuddyDao.getCarpoolBuddyFromUsernameAndCarpoolName(
           buddy.getUserName(), carpool.getName());
   assertEquals(carpoolBuddy, carpoolBuddyActual);
   carpoolBuddyDao.remove(buddy.getUserName(), carpool.getName());
 }
Example #3
0
 @Test
 public void shouldGetBuddyInsideCarpoolBuddyFromDB() {
   ArrayList<CarpoolBuddy> carpoolBuddies =
       carpoolBuddyDao.getCarpoolBuddiesByCarpoolName("carpool-1");
   assertThat(carpoolBuddies.get(0).getBuddy(), notNullValue());
 }
Example #4
0
 @Test
 public void shouldGetCarpoolBuddyFromDB() throws Exception {
   ArrayList<CarpoolBuddy> carpoolBuddies =
       carpoolBuddyDao.getCarpoolBuddiesByCarpoolName("carpool-1");
   assertThat(carpoolBuddies.size(), not(0));
 }