Search in sources :

Example 1 with ClientContactUpdateInfo

use of ch.aaap.harvestclient.domain.param.ClientContactUpdateInfo in project harvest-client by 3AP-AG.

the class ClientContactsApiUpdateTest method changeAll.

@Test
void changeAll() {
    // opposites of the defaults
    String title = "Mr. ";
    String firstName = "test first";
    String lastName = "test Last";
    String email = "hey@example.com";
    String phoneOffice = "006 00 12";
    String phoneMobile = "1232 32323 32 ";
    String fax = "this is a fax ?";
    ClientContactUpdateInfo changes = ImmutableClientContactUpdateInfo.builder().firstName(firstName).lastName(lastName).email(email).phoneMobile(phoneMobile).phoneOffice(phoneOffice).fax(fax).build();
    ClientContact updatedClientContact = clientContactsApi.update(clientContact, changes);
    assertThat(updatedClientContact).isEqualToComparingOnlyGivenFields(changes, "title", "firstName", "lastName", "email", "phoneOffice", "phoneMobile", "fax");
}
Also used : ClientContactUpdateInfo(ch.aaap.harvestclient.domain.param.ClientContactUpdateInfo) ImmutableClientContactUpdateInfo(ch.aaap.harvestclient.domain.param.ImmutableClientContactUpdateInfo) ImmutableClientContact(ch.aaap.harvestclient.domain.ImmutableClientContact) ClientContact(ch.aaap.harvestclient.domain.ClientContact) HarvestTest(ch.aaap.harvestclient.HarvestTest) Test(org.junit.jupiter.api.Test)

Example 2 with ClientContactUpdateInfo

use of ch.aaap.harvestclient.domain.param.ClientContactUpdateInfo in project harvest-client by 3AP-AG.

the class ClientContactsApiUpdateTest method changeFirstName.

@Test
void changeFirstName() {
    ClientContactUpdateInfo changes = ImmutableClientContactUpdateInfo.builder().firstName("new clientContact name").build();
    ClientContact updatedClientContact = clientContactsApi.update(clientContact, changes);
    assertThat(updatedClientContact.getFirstName()).isEqualTo(changes.getFirstName());
}
Also used : ClientContactUpdateInfo(ch.aaap.harvestclient.domain.param.ClientContactUpdateInfo) ImmutableClientContactUpdateInfo(ch.aaap.harvestclient.domain.param.ImmutableClientContactUpdateInfo) ImmutableClientContact(ch.aaap.harvestclient.domain.ImmutableClientContact) ClientContact(ch.aaap.harvestclient.domain.ClientContact) HarvestTest(ch.aaap.harvestclient.HarvestTest) Test(org.junit.jupiter.api.Test)

Aggregations

HarvestTest (ch.aaap.harvestclient.HarvestTest)2 ClientContact (ch.aaap.harvestclient.domain.ClientContact)2 ImmutableClientContact (ch.aaap.harvestclient.domain.ImmutableClientContact)2 ClientContactUpdateInfo (ch.aaap.harvestclient.domain.param.ClientContactUpdateInfo)2 ImmutableClientContactUpdateInfo (ch.aaap.harvestclient.domain.param.ImmutableClientContactUpdateInfo)2 Test (org.junit.jupiter.api.Test)2