Search in sources :

Example 1 with ProviderPutDataAttributes

use of org.folio.rest.jaxrs.model.ProviderPutDataAttributes in project mod-kb-ebsco-java by folio-org.

the class ProviderPutBodyValidatorTest method shouldNotThrowExceptionWhenTokenIsValidLength.

@Test
public void shouldNotThrowExceptionWhenTokenIsValidLength() {
    Token providerToken = new Token();
    providerToken.setValue(RandomStringUtils.randomAlphanumeric(500));
    ProviderPutRequest request = new ProviderPutRequest().withData(new ProviderPutData().withAttributes(new ProviderPutDataAttributes().withProviderToken(providerToken)));
    validator.validate(request);
}
Also used : Token(org.folio.rest.jaxrs.model.Token) ProviderPutRequest(org.folio.rest.jaxrs.model.ProviderPutRequest) ProviderPutDataAttributes(org.folio.rest.jaxrs.model.ProviderPutDataAttributes) ProviderPutData(org.folio.rest.jaxrs.model.ProviderPutData) Test(org.junit.Test)

Example 2 with ProviderPutDataAttributes

use of org.folio.rest.jaxrs.model.ProviderPutDataAttributes in project mod-kb-ebsco-java by folio-org.

the class ProviderPutBodyValidatorTest method shouldThrowExceptionWhenTokenIsTooLong.

@Test(expected = InputValidationException.class)
public void shouldThrowExceptionWhenTokenIsTooLong() {
    Token providerToken = new Token();
    providerToken.setValue(RandomStringUtils.randomAlphanumeric(501));
    ProviderPutRequest request = new ProviderPutRequest().withData(new ProviderPutData().withAttributes(new ProviderPutDataAttributes().withProviderToken(providerToken)));
    validator.validate(request);
}
Also used : Token(org.folio.rest.jaxrs.model.Token) ProviderPutRequest(org.folio.rest.jaxrs.model.ProviderPutRequest) ProviderPutDataAttributes(org.folio.rest.jaxrs.model.ProviderPutDataAttributes) ProviderPutData(org.folio.rest.jaxrs.model.ProviderPutData) Test(org.junit.Test)

Aggregations

ProviderPutData (org.folio.rest.jaxrs.model.ProviderPutData)2 ProviderPutDataAttributes (org.folio.rest.jaxrs.model.ProviderPutDataAttributes)2 ProviderPutRequest (org.folio.rest.jaxrs.model.ProviderPutRequest)2 Token (org.folio.rest.jaxrs.model.Token)2 Test (org.junit.Test)2