Skip to content

Commit

Permalink
#193: Fix MessageControllerTest
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Arnhold <[email protected]>
  • Loading branch information
jnsrnhld committed Jul 8, 2023
1 parent 71d27b9 commit 9e1971e
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import static java.util.Collections.emptyList;
import static org.hamcrest.Matchers.equalTo;
Expand All @@ -37,7 +38,7 @@ public class MessageControllerTest {

@Test
void getMessages_returnsMessages() throws Exception {
List<MessageDto> messageDtos = List.of(
Set<MessageDto> messageDtos = Set.of(
aMessage("persistent://public/default/spaceships", "Nebuchadnezzar"),
aMessage("persistent://public/default/spaceships", "Serenity")
);
Expand All @@ -54,7 +55,7 @@ void getMessages_returnsMessages() throws Exception {

@Test
void getMessages_withoutNumMessages_returns10Messages() throws Exception {
var messageDtos = new ArrayList<MessageDto>();
HashSet<MessageDto> messageDtos = new HashSet<>();
for (int i = 0; i < 10; i++) {
messageDtos.add(aMessage("persistent://public/default/test", "Test" + i));
}
Expand All @@ -70,7 +71,7 @@ void getMessages_withoutNumMessages_returns10Messages() throws Exception {

@Test
void getMessages_withProducer_returns10Messages() throws Exception {
var messageDtos = new ArrayList<MessageDto>();
HashSet<MessageDto> messageDtos = new HashSet<>();
for (int i = 0; i < 10; i++) {
messageDtos.add(aMessage("persistent://public/default/test", "Test" + i));
}
Expand All @@ -86,7 +87,7 @@ void getMessages_withProducer_returns10Messages() throws Exception {

@Test
void getMessages_withSubscription_returns10Messages() throws Exception {
var messageDtos = new ArrayList<MessageDto>();
HashSet<MessageDto> messageDtos = new HashSet<>();
for (int i = 0; i < 10; i++) {
messageDtos.add(aMessage("persistent://public/default/test", "Test" + i));
}
Expand Down

0 comments on commit 9e1971e

Please sign in to comment.