use of org.folio.repository.kbcredentials.DbKbCredentials in project mod-kb-ebsco-java by folio-org.
the class KbCredentialsNotSecuredCollectionConverterTest method shouldConvertKbCredentialsCollectionWithDefaultUrl.
@Test
public void shouldConvertKbCredentialsCollectionWithDefaultUrl() {
Collection<DbKbCredentials> credentialsCollection = getCredentialsCollectionNoUrl();
final KbCredentialsCollection kbCredentials = nonSecuredConverter.convert(credentialsCollection);
assertThat(kbCredentials.getMeta().getTotalResults(), equalTo(1));
assertThat(kbCredentials.getData().get(0).getType(), equalTo(KbCredentials.Type.KB_CREDENTIALS));
assertThat(kbCredentials.getData().get(0).getAttributes().getName(), equalTo(STUB_CREDENTIALS_NAME));
assertThat(kbCredentials.getData().get(0).getAttributes().getApiKey(), equalTo(STUB_API_KEY));
assertThat(kbCredentials.getData().get(0).getAttributes().getCustomerId(), equalTo(STUB_CUSTOMER_ID));
assertThat(kbCredentials.getData().get(0).getAttributes().getUrl(), equalTo(defaultUrl));
}
use of org.folio.repository.kbcredentials.DbKbCredentials in project mod-kb-ebsco-java by folio-org.
the class KbCredentialsNotSecuredCollectionConverterTest method shouldConvertKbCredentialsCollection.
@Test
public void shouldConvertKbCredentialsCollection() {
Collection<DbKbCredentials> credentialsCollection = getCredentialsCollection();
final KbCredentialsCollection kbCredentials = nonSecuredConverter.convert(credentialsCollection);
assertThat(kbCredentials.getMeta().getTotalResults(), equalTo(1));
assertThat(kbCredentials.getData().get(0).getType(), equalTo(KbCredentials.Type.KB_CREDENTIALS));
assertThat(kbCredentials.getData().get(0).getAttributes().getName(), equalTo(STUB_CREDENTIALS_NAME));
assertThat(kbCredentials.getData().get(0).getAttributes().getApiKey(), equalTo(STUB_API_KEY));
assertThat(kbCredentials.getData().get(0).getAttributes().getCustomerId(), equalTo(STUB_CUSTOMER_ID));
assertThat(kbCredentials.getData().get(0).getAttributes().getUrl(), equalTo(STUB_API_URL));
}
use of org.folio.repository.kbcredentials.DbKbCredentials in project mod-kb-ebsco-java by folio-org.
the class KbCredentialsNotSecuredConverterTest method shouldConvertKbCredentialsWithDefaultUrl.
@Test
public void shouldConvertKbCredentialsWithDefaultUrl() {
DbKbCredentials holding = getCredentialsNoUrl();
final KbCredentials kbCredentials = notSecuredConverter.convert(holding);
assertThat(kbCredentials.getType(), equalTo(KbCredentials.Type.KB_CREDENTIALS));
assertThat(kbCredentials.getAttributes().getName(), equalTo(STUB_CREDENTIALS_NAME));
assertThat(kbCredentials.getAttributes().getApiKey(), equalTo(STUB_API_KEY));
assertThat(kbCredentials.getAttributes().getCustomerId(), equalTo(STUB_CUSTOMER_ID));
assertThat(kbCredentials.getAttributes().getUrl(), equalTo(defaultUrl));
}
use of org.folio.repository.kbcredentials.DbKbCredentials in project mod-kb-ebsco-java by folio-org.
the class KbCredentialsSecuredCollectionConverterTest method shouldConvertKbCredentialsCollectionWithDefaultUrl.
@Test
public void shouldConvertKbCredentialsCollectionWithDefaultUrl() {
Collection<DbKbCredentials> credentialsCollection = getCredentialsCollectionNoUrl();
final KbCredentialsCollection kbCredentials = securedConverter.convert(credentialsCollection);
assertThat(kbCredentials.getMeta().getTotalResults(), equalTo(1));
assertThat(kbCredentials.getData().get(0).getType(), equalTo(KbCredentials.Type.KB_CREDENTIALS));
assertThat(kbCredentials.getData().get(0).getAttributes().getName(), equalTo(STUB_CREDENTIALS_NAME));
assertThat(kbCredentials.getData().get(0).getAttributes().getApiKey(), containsString("*"));
assertThat(kbCredentials.getData().get(0).getAttributes().getCustomerId(), equalTo(STUB_CUSTOMER_ID));
assertThat(kbCredentials.getData().get(0).getAttributes().getUrl(), equalTo(defaultUrl));
}
use of org.folio.repository.kbcredentials.DbKbCredentials in project mod-kb-ebsco-java by folio-org.
the class KbCredentialsSecuredConverterTest method shouldConvertKbCredentialsWithDefaultUrl.
@Test
public void shouldConvertKbCredentialsWithDefaultUrl() {
DbKbCredentials holding = getCredentialsNoUrl();
final KbCredentials kbCredentials = securedConverter.convert(holding);
assertThat(kbCredentials.getType(), equalTo(KbCredentials.Type.KB_CREDENTIALS));
assertThat(kbCredentials.getAttributes().getName(), equalTo(STUB_CREDENTIALS_NAME));
assertThat(kbCredentials.getAttributes().getApiKey(), containsString("*"));
assertThat(kbCredentials.getAttributes().getCustomerId(), equalTo(STUB_CUSTOMER_ID));
assertThat(kbCredentials.getAttributes().getUrl(), equalTo(defaultUrl));
}
Aggregations