Search in sources :

Example 1 with RequestProcessingException

use of ch.aaap.harvestclient.exception.RequestProcessingException in project harvest-client by 3AP-AG.

the class UsersApiImplTest method createExistingEmailFails.

@Test
void createExistingEmailFails() {
    RequestProcessingException exception = Assertions.assertThrows(RequestProcessingException.class, () -> {
        User creationInfo = ImmutableUser.builder().firstName(fixUserFirst).lastName(fixUserLast).email(fixUserEmail).build();
        api.create(creationInfo);
    });
    assertEquals(422, exception.getHttpCode());
    assertTrue(exception.getMessage().contains(fixUserEmail));
}
Also used : ImmutableUser(ch.aaap.harvestclient.domain.ImmutableUser) User(ch.aaap.harvestclient.domain.User) RequestProcessingException(ch.aaap.harvestclient.exception.RequestProcessingException) HarvestTest(ch.aaap.harvestclient.HarvestTest) Test(org.junit.jupiter.api.Test)

Aggregations

HarvestTest (ch.aaap.harvestclient.HarvestTest)1 ImmutableUser (ch.aaap.harvestclient.domain.ImmutableUser)1 User (ch.aaap.harvestclient.domain.User)1 RequestProcessingException (ch.aaap.harvestclient.exception.RequestProcessingException)1 Test (org.junit.jupiter.api.Test)1