use of org.folio.rest.jaxrs.model.ConfigurationStatus in project mod-kb-ebsco-java by folio-org.
the class EholdingsStatusTest method shouldReturnFalseWhenRMAPIRequestCompletesWithErrorStatus.
@Test
public void shouldReturnFalseWhenRMAPIRequestCompletesWithErrorStatus() {
setupDefaultKBConfiguration(getWiremockUrl(), vertx);
stubFor(get(new UrlPathPattern(new RegexPattern("/rm/rmaccounts.*"), true)).willReturn(new ResponseDefinitionBuilder().withStatus(401)));
final ConfigurationStatus status = getWithOk(EHOLDINGS_STATUS_PATH, STUB_TOKEN_HEADER).as(ConfigurationStatus.class);
assertThat(status.getData().getAttributes().getIsConfigurationValid(), equalTo(false));
}
use of org.folio.rest.jaxrs.model.ConfigurationStatus in project mod-kb-ebsco-java by folio-org.
the class EholdingsStatusTest method shouldReturnFalseIfEmptyConfig.
@Test
public void shouldReturnFalseIfEmptyConfig() {
final ConfigurationStatus status = getWithOk(EHOLDINGS_STATUS_PATH, STUB_TOKEN_HEADER).as(ConfigurationStatus.class);
assertThat(status.getData().getAttributes().getIsConfigurationValid(), equalTo(false));
}
use of org.folio.rest.jaxrs.model.ConfigurationStatus in project mod-kb-ebsco-java by folio-org.
the class EholdingsStatusTest method shouldReturnTrueWhenRMAPIRequestCompletesWith200Status.
@Test
public void shouldReturnTrueWhenRMAPIRequestCompletesWith200Status() throws IOException, URISyntaxException {
setupDefaultKBConfiguration(getWiremockUrl(), vertx);
stubFor(get(new UrlPathPattern(new RegexPattern("/rm/rmaccounts.*"), true)).willReturn(new ResponseDefinitionBuilder().withBody(readFile("responses/rmapi/vendors/get-zero-vendors-response.json"))));
final ConfigurationStatus status = getWithOk(EHOLDINGS_STATUS_PATH, STUB_TOKEN_HEADER).as(ConfigurationStatus.class);
assertThat(status.getData().getAttributes().getIsConfigurationValid(), equalTo(true));
}
Aggregations