Skip to content

Commit b1a17f4

Browse files
committed
Clean up message item reference
1 parent b4622fd commit b1a17f4

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/test/java/org/openapitools/client/api/MessagesApiTest.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,15 @@ public void listMessagesTest() throws ApiException {
8383

8484
assertThat(response, instanceOf(MessagesList.class));
8585
assertThat(response.getTotalCount(), greaterThan(0));
86-
assertThat(response.getMessages().get(0), instanceOf(ListMessageItem.class));
87-
assertThat(response.getMessages().get(0).getAccountId(), is(System.getenv("BW_ACCOUNT_ID")));
88-
assertThat(response.getMessages().get(0).getDestinationTn(), matchesRegex("^\\+[1-9]\\d{1,14}$"));
89-
assertThat(response.getMessages().get(0).getMessageDirection(), instanceOf(ListMessageDirectionEnum.class));
90-
assertThat(response.getMessages().get(0).getMessageId(), matchesRegex("^.+$"));
91-
assertThat(response.getMessages().get(0).getMessageStatus(), instanceOf(MessageStatusEnum.class));
92-
assertThat(response.getMessages().get(0).getMessageType(), instanceOf(MessageTypeEnum.class));
93-
assertThat(response.getMessages().get(0).getSegmentCount(), greaterThan(0));
86+
ListMessageItem message = response.getMessages().get(0);
87+
assertThat(message, instanceOf(ListMessageItem.class));
88+
assertThat(message.getAccountId(), is(System.getenv("BW_ACCOUNT_ID")));
89+
assertThat(message.getDestinationTn(), matchesRegex("^\\+[1-9]\\d{1,14}$"));
90+
assertThat(message.getMessageDirection(), instanceOf(ListMessageDirectionEnum.class));
91+
assertThat(message.getMessageId(), matchesRegex("^.+$"));
92+
assertThat(message.getMessageStatus(), instanceOf(MessageStatusEnum.class));
93+
assertThat(message.getMessageType(), instanceOf(MessageTypeEnum.class));
94+
assertThat(message.getSegmentCount(), greaterThan(0));
9495
}
9596

9697
@Test

0 commit comments

Comments
 (0)