44import com .intercom .api .core .pagination .SyncPage ;
55import com .intercom .api .core .pagination .SyncPagingIterable ;
66import com .intercom .api .resources .companies .requests .AttachContactToCompanyRequest ;
7- import com .intercom .api .resources . companies . requests .CreateOrUpdateCompanyRequest ;
7+ import com .intercom .api .types .CreateOrUpdateCompanyRequest ;
88import com .intercom .api .resources .companies .requests .DeleteCompanyRequest ;
99import com .intercom .api .resources .companies .requests .DetachContactFromCompanyRequest ;
1010import com .intercom .api .resources .companies .requests .FindCompanyRequest ;
@@ -42,9 +42,9 @@ public void before() {
4242 client .contacts ().list (ListContactsRequest .builder ().perPage (1 ).build ());
4343
4444 // act
45- contactId = randomContacts .getItems ().get (0 ).getId ();
45+ contactId = randomContacts .getItems ().get (0 ).getId (). orElseThrow (() -> new RuntimeException ( "Contact ID is required" )) ;
4646 company = client .companies ()
47- .createOrUpdate (CreateOrUpdateCompanyRequest .builder ()
47+ .createOrUpdate (java . util . Optional . of ( CreateOrUpdateCompanyRequest .builder ()
4848 .name (Utils .randomString ())
4949 .companyId (Utils .randomString ())
5050 .plan ("1. Get pizzaid" )
@@ -53,7 +53,7 @@ public void before() {
5353 .industry ("The Best One" )
5454 .remoteCreatedAt ((int ) (new Date ().toInstant ().toEpochMilli () / 1000L ))
5555 .monthlySpend (9001 )
56- .build ());
56+ .build ())) ;
5757 companyId = company .getId ();
5858
5959 deleteAfter = true ;
@@ -77,7 +77,7 @@ public void testCreate() {
7777 public void testUpdate () {
7878 // act
7979 Company response = client .companies ()
80- .createOrUpdate (CreateOrUpdateCompanyRequest .builder ()
80+ .createOrUpdate (java . util . Optional . of ( CreateOrUpdateCompanyRequest .builder ()
8181 .name (Utils .randomString ())
8282 .companyId (Utils .randomString ())
8383 .plan ("1. Get pizzaid" )
@@ -86,7 +86,7 @@ public void testUpdate() {
8686 .industry ("The Best One" )
8787 .remoteCreatedAt ((int ) (new Date ().toInstant ().toEpochMilli () / 1000L ))
8888 .monthlySpend (9001 )
89- .build ());
89+ .build ())) ;
9090
9191 // assert
9292 Assertions .assertNotNull (response );
@@ -164,8 +164,6 @@ public void testListAttachedContacts() {
164164 CompanyAttachedContacts response = client .companies ()
165165 .listAttachedContacts (ListAttachedContactsRequest .builder ()
166166 .companyId (companyId )
167- .page (1 )
168- .perPage (25 )
169167 .build ());
170168
171169 // assert
0 commit comments