return chatHome.getChatRooms().map(chatroom -> ChatRoomTo.from(chatroom));
}
- @GetMapping("list/{chatroomId}")
+ @GetMapping("{chatroomId}/list")
public Flux<MessageTo> list(@PathVariable UUID chatroomId)
{
return chatHome
.map(MessageTo::from));
}
- @GetMapping("get/{chatroomId}")
+ @GetMapping("{chatroomId}")
public Mono<ChatRoomTo> get(@PathVariable UUID chatroomId)
{
return chatHome.getChatRoom(chatroomId).map(chatroom -> ChatRoomTo.from(chatroom));
}
- @PutMapping("put/{chatroomId}/{username}/{messageId}")
+ @PutMapping("{chatroomId}/{username}/{messageId}")
public Mono<MessageTo> put(
@PathVariable UUID chatroomId,
@PathVariable String username,
.map(message -> MessageTo.from(message));
}
- @GetMapping("get/{chatroomId}/{username}/{messageId}")
+ @GetMapping("{chatroomId}/{username}/{messageId}")
public Mono<MessageTo> get(
@PathVariable UUID chatroomId,
@PathVariable String username,
.map(message -> MessageTo.from(message));
}
- @GetMapping(path = "listen/{chatroomId}")
+ @GetMapping(path = "{chatroomId}/listen")
public Flux<ServerSentEvent<MessageTo>> listen(@PathVariable UUID chatroomId)
{
return chatHome
// When
WebTestClient.ResponseSpec responseSpec = client
.get()
- .uri("/list/{chatroomId}", chatroomId)
+ .uri("/{chatroomId}/list", chatroomId)
.accept(MediaType.APPLICATION_JSON)
.exchange();
// When
WebTestClient.ResponseSpec responseSpec = client
.get()
- .uri("/get/{chatroomId}", chatroomId)
+ .uri("/{chatroomId}", chatroomId)
.accept(MediaType.APPLICATION_JSON)
.exchange();
WebTestClient.ResponseSpec responseSpec = client
.put()
.uri(
- "/put/{chatroomId}/{username}/{messageId}",
+ "/{chatroomId}/{username}/{messageId}",
chatroomId,
username,
messageId)
WebTestClient.ResponseSpec responseSpec = client
.get()
.uri(
- "/get/{chatroomId}/{username}/{messageId}",
+ "/{chatroomId}/{username}/{messageId}",
chatroomId,
username,
messageId)
// When
WebTestClient.ResponseSpec responseSpec = client
.get()
- .uri("/listen/{chatroomId}", chatroomId)
+ .uri("/{chatroomId}/listen", chatroomId)
// .accept(MediaType.TEXT_EVENT_STREAM, MediaType.APPLICATION_JSON) << TODO: Does not work!
.exchange();
client
.put()
.uri(
- "/put/{chatroomId}/{username}/{messageId}",
+ "/{chatroomId}/{username}/{messageId}",
chatroomId,
user,
messageId)
client
.put()
.uri(
- "/put/{chatroomId}/{username}/{messageId}",
+ "/{chatroomId}/{username}/{messageId}",
chatroomId,
user,
messageId)