Skip to content

Commit 7aa888d

Browse files
mailsongabrielfern-api[bot]claude
authored
Fern bot/2026 02 02 t19 11 z (#358)
* SDK regeneration * Update tests for required field changes in SDK Remove .orElseThrow() calls from tests where the SDK now returns non-optional types for id and conversation_id fields: - ContactsCreateResponse.getId() now returns String - Conversation.getId() now returns String - Message.getConversationId() now returns String - Note.getId() now returns String Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix remaining test files for required field changes Update MessagesTest, IntegrationTest, and CompaniesTest to remove .orElseThrow() calls that are no longer needed since the SDK now returns non-optional types. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 95b6cb4 commit 7aa888d

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

src/test/java/com/intercom/api/integration/CompaniesTest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ public void before() {
4242
client.contacts().list(ListContactsRequest.builder().perPage(1).build());
4343

4444
// act
45-
contactId = randomContacts
46-
.getItems()
47-
.get(0)
48-
.getId()
49-
.orElseThrow(() -> new RuntimeException("Contact ID is required"));
45+
contactId = randomContacts.getItems().get(0).getId();
5046
company = client.companies()
5147
.createOrUpdate(java.util.Optional.of(CreateOrUpdateCompanyRequest.builder()
5248
.name(Utils.randomString())

src/test/java/com/intercom/api/integration/IntegrationTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ public void before() {
6161
.create(CreateContactRequest.of(CreateContactRequest.WithExternalId.builder()
6262
.externalId(Utils.randomString())
6363
.build()));
64-
userId = user.getId().orElseThrow(() -> new RuntimeException("User ID is required"));
64+
userId = user.getId();
6565
lead = client.contacts()
6666
.create(CreateContactRequest.of(CreateContactRequest.WithRole.builder()
6767
.role("lead")
6868
.name("Marek Barek")
6969
.build()));
70-
leadId = lead.getId().orElseThrow(() -> new RuntimeException("Lead ID is required"));
70+
leadId = lead.getId();
7171
tag = client.tags()
7272
.create(TagsCreateRequestBody.of(CreateOrUpdateTagRequest.builder()
7373
.name(Utils.randomString())
@@ -126,8 +126,7 @@ public void testTagConversation() {
126126
// act
127127
Tag response = client.tags()
128128
.tagConversation(TagConversationRequest.builder()
129-
.conversationId(message.getConversationId()
130-
.orElseThrow(() -> new RuntimeException("Conversation ID is required")))
129+
.conversationId(message.getConversationId())
131130
.tagId(tag.getId())
132131
.adminId(adminId)
133132
.build());

src/test/java/com/intercom/api/integration/MessagesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void before() {
4242
.externalId(Utils.randomString())
4343
.name("Message Test User")
4444
.build()));
45-
userId = user.getId().orElseThrow(() -> new RuntimeException("User ID is required"));
45+
userId = user.getId();
4646
}
4747

4848
@AfterEach

0 commit comments

Comments
 (0)