Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECO-5188] fix: message actions based on specification update #1057

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions lib/src/main/java/io/ably/lib/types/MessageAction.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package io.ably.lib.types;

public enum MessageAction {
MESSAGE_UNSET, // 0
MESSAGE_CREATE, // 1
MESSAGE_UPDATE, // 2
MESSAGE_DELETE, // 3
ANNOTATION_CREATE, // 4
ANNOTATION_DELETE, // 5
META_OCCUPANCY; // 6
MESSAGE_CREATE, // 0
MESSAGE_UPDATE, // 1
MESSAGE_DELETE, // 2
META_OCCUPANCY, // 3
MESSAGE_SUMMARY; // 4
ttypic marked this conversation as resolved.
Show resolved Hide resolved

static MessageAction tryFindByOrdinal(int ordinal) {
return values().length <= ordinal ? null: values()[ordinal];
Expand Down
4 changes: 2 additions & 2 deletions lib/src/test/java/io/ably/lib/types/MessageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void serialize_message_with_serial() {
assertEquals("test-key", serializedObject.get("connectionKey").getAsString());
assertEquals("test-data", serializedObject.get("data").getAsString());
assertEquals("test-name", serializedObject.get("name").getAsString());
assertEquals(1, serializedObject.get("action").getAsInt());
assertEquals(0, serializedObject.get("action").getAsInt());
ttypic marked this conversation as resolved.
Show resolved Hide resolved
assertEquals("01826232498871-001@abcdefghij:001", serializedObject.get("serial").getAsString());
}

Expand All @@ -76,7 +76,7 @@ public void deserialize_message_with_serial() throws Exception {
jsonObject.addProperty("clientId", "test-client-id");
jsonObject.addProperty("data", "test-data");
jsonObject.addProperty("name", "test-name");
jsonObject.addProperty("action", 1);
jsonObject.addProperty("action", 0);
jsonObject.addProperty("serial", "01826232498871-001@abcdefghij:001");

// When
Expand Down
Loading