Skip to content

Commit

Permalink
test: EventCommandServiceTest 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hong-sile committed Jan 12, 2024
1 parent 60e8b72 commit f298073
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,20 +160,20 @@ void addEventTest() {
final Event savedEvent = eventRepository.findById(response.getId()).get();

//then
assertThat(response.getTags())
.extracting("name")
.containsExactlyInAnyOrderElementsOf(
tagRequests.stream()
.map(TagRequest::getName)
.collect(Collectors.toList())
);
assertAll(
() -> assertEquals(eventName, savedEvent.getName()),
() -> assertEquals(eventLocation, savedEvent.getLocation()),
() -> assertEquals(eventInformationUrl, savedEvent.getInformationUrl()),
() -> assertEquals(beforeDateTime, savedEvent.getEventPeriod().getStartDate()),
() -> assertEquals(afterDateTime, savedEvent.getEventPeriod().getEndDate())
);
assertThat(response.getTags())
.extracting("name")
.containsExactlyInAnyOrder(
tagRequests.stream()
.map(TagRequest::getName)
.collect(Collectors.toList())
);
}

@Test
Expand Down Expand Up @@ -320,20 +320,20 @@ void updateEventTest() {
final Event updatedEvent = eventRepository.findById(eventId).get();

//then
assertThat(response.getTags())
.extracting("name")
.containsExactlyInAnyOrderElementsOf(
newTagRequests.stream()
.map(TagRequest::getName)
.collect(Collectors.toList())
);
assertAll(
() -> assertEquals(newName, updatedEvent.getName()),
() -> assertEquals(newLocation, updatedEvent.getLocation()),
() -> assertEquals(newStartDateTime, updatedEvent.getEventPeriod().getStartDate()),
() -> assertEquals(newEndDateTime, updatedEvent.getEventPeriod().getEndDate()),
() -> assertEquals(newInformationUrl, updatedEvent.getInformationUrl())
);
assertThat(response.getTags())
.extracting("name")
.containsExactlyInAnyOrder(
newTagRequests.stream()
.map(TagRequest::getName)
.collect(Collectors.toList())
);
}

@Test
Expand Down

0 comments on commit f298073

Please sign in to comment.