diff --git a/chat-client-java-lib/pom.xml b/chat-client-java-lib/pom.xml index d805240..8cb5706 100644 --- a/chat-client-java-lib/pom.xml +++ b/chat-client-java-lib/pom.xml @@ -56,10 +56,6 @@ - - io.swagger - swagger-annotations - com.fasterxml.jackson.core jackson-core diff --git a/chat-server-generated/src/main/java/cz/muni/chat/generated/server/api/ChatImpl.java b/chat-server-generated/src/main/java/cz/muni/chat/generated/server/api/ChatImpl.java index 74ef0c9..673e440 100644 --- a/chat-server-generated/src/main/java/cz/muni/chat/generated/server/api/ChatImpl.java +++ b/chat-server-generated/src/main/java/cz/muni/chat/generated/server/api/ChatImpl.java @@ -48,12 +48,9 @@ public ResponseEntity createMessage(NewChatMessageRequest r, String String text = r.getText(); BackgroundColorEnum backgroundColor = r.getBackgroundColor(); TextColorEnum textColor = r.getTextColor(); - ChatMessage chatMessage = new ChatMessage() - .id(UUID.randomUUID().toString()) - .timestamp(OffsetDateTime.now()) + ChatMessage chatMessage = new ChatMessage(UUID.randomUUID().toString(), OffsetDateTime.now(), text) .author(author) - .text(text) - .textColor(textColor.getValue()) + .textColor(textColor != null ? textColor.getValue() : null) .backgroundColor(backgroundColor); messages.add(0, chatMessage); return new ResponseEntity<>(chatMessage, HttpStatus.CREATED); @@ -70,16 +67,14 @@ public ResponseEntity paged(Integer page, Integer size, List paged(Integer page, Integer size, List(pageChatMessage, HttpStatus.OK); + .sort(s); + return new ResponseEntity<>(pageChatMessage, HttpStatus.OK); } private final List messages = new CopyOnWriteArrayList<>(); diff --git a/chat-server-generated/src/test/java/cz/muni/chat/generated/server/GeneratedServerIT.java b/chat-server-generated/src/test/java/cz/muni/chat/generated/server/GeneratedServerIT.java index a654cbb..53c1fd4 100644 --- a/chat-server-generated/src/test/java/cz/muni/chat/generated/server/GeneratedServerIT.java +++ b/chat-server-generated/src/test/java/cz/muni/chat/generated/server/GeneratedServerIT.java @@ -47,8 +47,7 @@ void testMessageIds() throws Exception { String text = "message " + i; TextColorEnum textColor = TextColorEnum.BLACK; BackgroundColorEnum backgroundColor = BackgroundColorEnum.WHITE; - NewChatMessageRequest n = new NewChatMessageRequest(); - n.setText(text); + NewChatMessageRequest n = new NewChatMessageRequest(text); n.setTextColor(textColor); n.setBackgroundColor(backgroundColor); String response = mockMvc.perform(post("/api/messages?author=" + author)