This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.its.reservation.service; | |
import org.springframework.stereotype.Service; | |
import com.its.reservation.repository.Reservation; | |
@Service | |
public class ReservationService { | |
public Reservation getReservationDetails(String name) { | |
return null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestController | |
@RequestMapping("/reservation") | |
public class ReservationController { | |
private ReservationService reservationService; | |
public ReservationController(ReservationService reservationService) { | |
this.reservationService = reservationService; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.its.reservation.web; | |
import org.springframework.web.bind.annotation.PathVariable; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RequestMethod; | |
import org.springframework.web.bind.annotation.RestController; | |
import com.its.reservation.repository.Reservation; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; | |
import org.springframework.test.context.junit4.SpringRunner; | |
import org.springframework.test.web.servlet.MockMvc; | |
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; | |
import org.springframework.test.web.servlet.result.MockMvcResultMatchers; | |
import com.its.reservation.web.ReservationController; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.its.reservation; | |
import org.assertj.core.api.Assertions; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.test.context.SpringBootTest; | |
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; | |
import org.springframework.boot.test.web.client.TestRestTemplate; | |
import org.springframework.http.HttpStatus; |
NewerOlder