Skip to content

Instantly share code, notes, and snippets.

@dhaval201279
Last active March 11, 2018 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhaval201279/dab401703dce102596c2b6e81df06402 to your computer and use it in GitHub Desktop.
Save dhaval201279/dab401703dce102596c2b6e81df06402 to your computer and use it in GitHub Desktop.
1st version of ReservationServiceTest - which fails initially
package com.its.reservation;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import com.its.reservation.repository.Reservation;
import com.its.reservation.service.ReservationService;
@RunWith(MockitoJUnitRunner.class)
public class ReservationServiceTest {
ReservationService reservationservice;
@Before
public void setUp() throws Exception {
reservationService = new ReservationService();
}
@Test
public void getReservationDetails_returnsReservationInfo() {
Reservation aReservation = reservationservice.getReservationDetails("Dhaval");
assertThat(aReservation.getFirstName()).isEqualTo("Dhaval");
assertThat(aReservation.getFirstName()).isEqualTo("Shah");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment