diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/core/management/user/UserService.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/core/management/user/UserService.java index 55ce5e598a038718764cfb6ec40fbfed4d029dac..124a207aa523d5f6dedb5602e6acea7bee8b3e12 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/core/management/user/UserService.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/core/management/user/UserService.java @@ -44,7 +44,7 @@ public class UserService { return registrationError(); } } - + /** * checks if a user exists in order to log him in * diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/communication/service/CommunicationDummyService.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/communication/service/CommunicationDummyService.java index b2b4fe61e0f3cebc00da5d47b42158e405df286d..660cf5d02cb606e2b214bd2c18e3ab1d28455feb 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/communication/service/CommunicationDummyService.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/communication/service/CommunicationDummyService.java @@ -6,38 +6,46 @@ import unipotsdam.gf.modules.communication.model.Message; import unipotsdam.gf.modules.communication.model.chat.ChatMessage; import unipotsdam.gf.modules.communication.model.chat.ChatRoom; +import java.time.Instant; +import java.util.ArrayList; import java.util.List; public class CommunicationDummyService implements ICommunication { @Override public List<ChatMessage> getChatHistory(String roomId) { - return null; + ArrayList<ChatMessage> chatMessages = new ArrayList<>(); + int maxValue = 6; + for (int i = 1;i <= maxValue;i++) { + chatMessages.add(new ChatMessage(String.valueOf(i+1), "Dies ist ein Test" + i + " .", + Instant.now().minusSeconds(maxValue * 10 - i * 10),"testUser" + i)); + } + return chatMessages; } @Override public boolean sendMessageToChat(Message message) { - return false; + throw new RuntimeException("Do not call this method without implementation"); } @Override public String createChatRoom(String name, List<User> studentIdentifierList) { - return null; + return "1"; } @Override public boolean addUserToChatRoom(String roomId, User user) { - return false; + throw new RuntimeException("Do not call this method without implementation"); } @Override public boolean setChatRoomTopic(String roomId, String topic) { - return false; + throw new RuntimeException("Do not call this method without implementation"); } @Override public ChatRoom getChatRoomInfo(String roomId) { - return null; + return new ChatRoom("1", "test"); } @Override