Skip to content

Commit

Permalink
update codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyH277 committed Jun 4, 2024
1 parent 98f2d4e commit 0c645b5
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ void setUp() {
void addAccommodation_ValidRequest_ReturnsCreatedAccommodation() throws Exception {
CreateAccommodationRequestDto requestDto = createRequestDto();
AccommodationDto responseDto = createResponseDto();
given(accommodationService.create(any(CreateAccommodationRequestDto.class))).willReturn(responseDto);
given(accommodationService.create(any(CreateAccommodationRequestDto.class)))
.willReturn(responseDto);

mockMvc.perform(post("/accommodations")
.contentType(MediaType.APPLICATION_JSON)
Expand Down Expand Up @@ -108,7 +109,9 @@ void updateAccommodation_ValidRequest_ReturnsUpdatedAccommodation() throws Excep
Long id = 1L;
CreateAccommodationRequestDto requestDto = createRequestDto();
AccommodationDto responseDto = createResponseDto();
given(accommodationService.updateAccommodation(eq(id), any(CreateAccommodationRequestDto.class))).willReturn(responseDto);
given(accommodationService.updateAccommodation(eq(id),
any(CreateAccommodationRequestDto.class)))
.willReturn(responseDto);

mockMvc.perform(put("/accommodations/{id}", id)
.contentType(MediaType.APPLICATION_JSON)
Expand All @@ -123,7 +126,9 @@ void partiallyUpdateAccommodation_ValidRequest_ReturnsUpdatedAccommodation() thr
Long id = 1L;
CreateAccommodationRequestDto requestDto = createRequestDto();
AccommodationDto responseDto = createResponseDto();
given(accommodationService.patchAccommodation(eq(id), any(CreateAccommodationRequestDto.class))).willReturn(responseDto);
given(accommodationService.patchAccommodation(eq(id),
any(CreateAccommodationRequestDto.class)))
.willReturn(responseDto);

mockMvc.perform(patch("/accommodations/{id}", id)
.contentType(MediaType.APPLICATION_JSON)
Expand Down Expand Up @@ -166,8 +171,9 @@ private CreateAccommodationRequestDto createRequestDto() {
}

private Set<CreateAmenityRequestDto> createAmenityRequestDto() {
Set<CreateAmenityRequestDto> amenities = Set.of(new CreateAmenityRequestDto("Test amenity 1"),
new CreateAmenityRequestDto("Test amenity 2"));
Set<CreateAmenityRequestDto> amenities =
Set.of(new CreateAmenityRequestDto("Test amenity 1"),
new CreateAmenityRequestDto("Test amenity 2"));
return amenities;

}
Expand Down

0 comments on commit 0c645b5

Please sign in to comment.