@Test @DisplayName("지하철 역 등록하기") public void createStation() { String stationName = "강남역"; StationCreationRequest stationCreationRequest = StationCreationRequest.builder() .name(stationName) .build(); StationCreationResponse stationCreationResponse = stationService.createStation(stationCreationRequest); assertThat(stationCreationResponse.getName(), is(stationName)); }
public StationCreationResponse createStation(StationCreationRequest stationCreationRequest) { Station station = stationRepository.save(stationCreationRequest.toEntity()); return station.toStationCreationResponse(); }
StationService { public StationCreationResponse createStation(StationCreationRequest stationCreationRequest) { Station station = stationRepository.save(stationCreationRequest.toEntity()); return station.toStationCreationResponse(); } }
StationService { public StationCreationResponse createStation(StationCreationRequest stationCreationRequest) { Station station = stationRepository.save(stationCreationRequest.toEntity()); return station.toStationCreationResponse(); } StationService(StationRepository stationRepository); }
StationService { public StationCreationResponse createStation(StationCreationRequest stationCreationRequest) { Station station = stationRepository.save(stationCreationRequest.toEntity()); return station.toStationCreationResponse(); } StationService(StationRepository stationRepository); StationCreationResponse createStation(StationCreationRequest stationCreationRequest); }
StationService { public StationCreationResponse createStation(StationCreationRequest stationCreationRequest) { Station station = stationRepository.save(stationCreationRequest.toEntity()); return station.toStationCreationResponse(); } StationService(StationRepository stationRepository); StationCreationResponse createStation(StationCreationRequest stationCreationRequest);  }