Skip to content

Commit

Permalink
Add is directory moving header (#45)
Browse files Browse the repository at this point in the history
Signed-off-by: Seddik Yengui <seddik.yengui@rte-france.com>
  • Loading branch information
YenguiSeddik authored and jonenst committed Oct 29, 2024
1 parent 9567f9e commit 3fdd831
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class DirectoryNotificationWebSocketHandler implements WebSocketHandler {
static final String HEADER_IS_ROOT_DIRECTORY = "isRootDirectory";
static final String HEADER_NOTIFICATION_TYPE = "notificationType";
static final String HEADER_ELEMENT_UUID = "elementUuid";
static final String HEADER_IS_DIRECTORY_MOVING = "isDirectoryMoving";
static final String HEADER_USER_MESSAGE = "userMessage";

private ObjectMapper jacksonObjectMapper;
Expand Down Expand Up @@ -149,6 +150,9 @@ private static Map<String, Object> toResultHeader(Map<String, Object> messageHea
if (messageHeader.get(HEADER_ELEMENT_UUID) != null) {
resHeader.put(HEADER_ELEMENT_UUID, messageHeader.get(HEADER_ELEMENT_UUID));
}
if (messageHeader.get(HEADER_IS_DIRECTORY_MOVING) != null) {
resHeader.put(HEADER_IS_DIRECTORY_MOVING, messageHeader.get(HEADER_IS_DIRECTORY_MOVING));
}
if (messageHeader.get(HEADER_USER_MESSAGE) != null) {
resHeader.put(HEADER_USER_MESSAGE, messageHeader.get(HEADER_USER_MESSAGE));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void testWithFilters(String filterUpdateType, String filterElementUuid, boolean
Map.of(HEADER_DIRECTORY_UUID, "public_" + otherUserId, HEADER_UPDATE_TYPE, "rab", HEADER_USER_ID, otherUserId, HEADER_IS_PUBLIC_DIRECTORY, true, HEADER_ELEMENT_NAME, "toto"),
Map.of(HEADER_DIRECTORY_UUID, "private_" + otherUserId, HEADER_UPDATE_TYPE, "rab", HEADER_USER_ID, otherUserId, HEADER_IS_PUBLIC_DIRECTORY, false),
Map.of(HEADER_DIRECTORY_UUID, "public_" + otherUserId, HEADER_UPDATE_TYPE, "rab", HEADER_USER_ID, otherUserId, HEADER_IS_PUBLIC_DIRECTORY, true,
HEADER_ERROR, "error_message", HEADER_NOTIFICATION_TYPE, "UPDATE_DIRECTORY", HEADER_IS_ROOT_DIRECTORY, "false", HEADER_ELEMENT_NAME, "tutu"),
HEADER_ERROR, "error_message", HEADER_NOTIFICATION_TYPE, "UPDATE_DIRECTORY", HEADER_IS_ROOT_DIRECTORY, "false", HEADER_ELEMENT_NAME, "tutu", HEADER_IS_DIRECTORY_MOVING, "false"),
Map.of(HEADER_ELEMENT_UUID, ELEMENT_UUID, HEADER_USER_ID, connectedUserId),
Map.of(HEADER_USER_ID, connectedUserId, HEADER_USER_MESSAGE, "testMessage")
).map(map -> new GenericMessage<>("", map)).toList();
Expand Down Expand Up @@ -242,6 +242,9 @@ private static Map<String, Object> toResultHeader(Map<String, Object> messageHea
if (messageHeader.get(HEADER_ELEMENT_UUID) != null) {
resHeader.put(HEADER_ELEMENT_UUID, messageHeader.get(HEADER_ELEMENT_UUID));
}
if (messageHeader.get(HEADER_IS_DIRECTORY_MOVING) != null) {
resHeader.put(HEADER_IS_DIRECTORY_MOVING, messageHeader.get(HEADER_IS_DIRECTORY_MOVING));
}
if (messageHeader.get(HEADER_USER_MESSAGE) != null) {
resHeader.put(HEADER_USER_MESSAGE, messageHeader.get(HEADER_USER_MESSAGE));
}
Expand Down

0 comments on commit 3fdd831

Please sign in to comment.