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

Fixing Queue representation in ConnectEvent.java #482

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static class ContactData implements Serializable, Cloneable {
private String initiationMethod;
private String instanceArn;
private String previousContactId;
private String queue;
private Queue queue;
private SystemEndpoint systemEndpoint;
}

Expand All @@ -72,6 +72,15 @@ public static class CustomerEndpoint implements Serializable, Cloneable {
private String type;
}

@Data
@Builder(setterPrefix = "with")
@NoArgsConstructor
@AllArgsConstructor
public static class Queue implements Serializable, Cloneable {
private String name;
private String arn;
}

@Data
@Builder(setterPrefix = "with")
@NoArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ public void testLoadConnectEvent() {
assertThat(contactData.getSystemEndpoint())
.returns("+21234567890",from(ConnectEvent.SystemEndpoint::getAddress))
.returns("TELEPHONE_NUMBER",from(ConnectEvent.SystemEndpoint::getType));

assertThat(contactData.getQueue())
.returns("arn:aws:connect:eu-central-1:123456789012:instance/9308c2a1-9bc6-4cea-8290-6c0b4a6d38fa/queue/941464de-39b7-4cae-82e9-a44f070ef59e", from(ConnectEvent.Queue::getArn))
.returns("ExampleQueue",from(ConnectEvent.Queue::getName));
}

@Test
Expand Down
5 changes: 4 additions & 1 deletion aws-lambda-java-tests/src/test/resources/connect_event.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
}
},
"PreviousContactId": "4ca32fbd-8f92-46af-92a5-6b0f970f0efe",
"Queue": null,
"Queue": {
"ARN": "arn:aws:connect:eu-central-1:123456789012:instance/9308c2a1-9bc6-4cea-8290-6c0b4a6d38fa/queue/941464de-39b7-4cae-82e9-a44f070ef59e",
"Name": "PasswordReset"
},
"SystemEndpoint": {
"Address": "+21234567890",
"Type": "TELEPHONE_NUMBER"
Expand Down
Loading