use of org.hl7.fhir.r4.model.Endpoint in project cqf-ruler by DBCG.
the class CacheValueSetsProviderIT method testCacheValueSetsValueSetNull.
@Test
public void testCacheValueSetsValueSetNull() throws Exception {
Endpoint endpoint = uploadLocalServerEndpoint();
StringAndListParam stringAndListParam = new StringAndListParam();
stringAndListParam.setValuesAsQueryTokens(getFhirContext(), "valueset", Arrays.asList(QualifiedParamList.singleton(new ValueSet().getId())));
RequestDetails details = Mockito.mock(RequestDetails.class);
Resource outcomeResource = cacheValueSetsProvider.cacheValuesets(details, endpoint.getIdElement(), stringAndListParam, null, null);
validateOutcome(outcomeResource, "HTTP 404 : Resource ValueSet/" + new ValueSet().getIdElement().getIdPart() + " is not known");
}
use of org.hl7.fhir.r4.model.Endpoint in project cqf-ruler by DBCG.
the class CacheValueSetsProviderIT method testCacheValueSetsAuthenticationErrorPassword.
@Test
public void testCacheValueSetsAuthenticationErrorPassword() throws Exception {
Endpoint endpoint = uploadLocalServerEndpoint();
StringAndListParam stringAndListParam = getStringAndListParamFromValueSet("valueset/AcuteInpatient.json");
RequestDetails details = Mockito.mock(RequestDetails.class);
Resource outcomeResource = cacheValueSetsProvider.cacheValuesets(details, endpoint.getIdElement(), stringAndListParam, null, "password");
String detailMessage = "Password was provided, but not a user name.";
validateOutcome(outcomeResource, detailMessage);
}
use of org.hl7.fhir.r4.model.Endpoint in project cqf-ruler by DBCG.
the class CacheValueSetsProviderIT method uploadLocalServerEndpoint.
private Endpoint uploadLocalServerEndpoint() throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(CacheValueSetsProvider.class.getResourceAsStream("endpoint/LocalServerEndpoint.json")));
String resourceString = reader.lines().collect(Collectors.joining(System.lineSeparator()));
reader.close();
// Don't want to update during loading because need to setAddress first
Endpoint endpoint = (Endpoint) loadResource("json", resourceString);
endpoint.setAddress("http://localhost:" + getPort() + "/fhir/");
create(endpoint);
return endpoint;
}
use of org.hl7.fhir.r4.model.Endpoint in project cqf-ruler by DBCG.
the class CacheValueSetsProviderIT method testCacheValueSetsEndpointDNE.
@Test
public void testCacheValueSetsEndpointDNE() throws Exception {
Endpoint endpoint = new Endpoint();
endpoint.setId(new IdType("localhost"));
StringAndListParam stringAndListParam = getStringAndListParamFromValueSet("valueset/AcuteInpatient.json");
RequestDetails details = Mockito.mock(RequestDetails.class);
Resource outcomeResource = cacheValueSetsProvider.cacheValuesets(details, endpoint.getIdElement(), stringAndListParam, null, null);
String detailMessage = "Could not find Endpoint/" + endpoint.getIdElement().getIdPart();
validateOutcome(outcomeResource, detailMessage);
}
use of org.hl7.fhir.r4.model.Endpoint in project cqf-ruler by DBCG.
the class CacheValueSetsProviderIT method testCacheValueSetsValueSetNull.
@Test
public void testCacheValueSetsValueSetNull() throws Exception {
Endpoint endpoint = uploadLocalServerEndpoint();
StringAndListParam stringAndListParam = new StringAndListParam();
stringAndListParam.setValuesAsQueryTokens(getFhirContext(), "valueset", Arrays.asList(QualifiedParamList.singleton(new ValueSet().getId())));
RequestDetails details = Mockito.mock(RequestDetails.class);
Resource outcomeResource = cacheValueSetsProvider.cacheValuesets(details, endpoint.getIdElement(), stringAndListParam, null, null);
validateOutcome(outcomeResource, "HTTP 404 : Resource ValueSet/" + new ValueSet().getIdElement().getIdPart() + " is not known");
}
Aggregations