Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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