Package ca.cdr.test.app.harness.api
Interface SmileHarness
- All Known Implementing Classes:
LocalhostSmileHarness
public interface SmileHarness
Interface for interacting with a Smile CDR instance during testing.
Provides methods to obtain various clients for communicating with the CDR,
including administrative JSON clients and FHIR clients with different
authentication levels.
-
Method Summary
Modifier and TypeMethodDescriptionGets an administrative JSON client for interacting with the CDR's admin API.getAdminJsonClient
(int thePort) Gets anAdminJsonRestClient
for interacting with the CDR's admin API on a specific port.Gets a standard FHIR client.getFhirClient
(int thePort) Gets a standard FHIR client on a specific port.getFhirClient
(String theModuleId) Gets a standard FHIR client for a specific module.Gets the FHIR context used by this harness.getFhirContext
(String moduleId) Gets the FHIR context for a specific module.Gets an HL7V2 REST client for interacting with the CDR's HL7V2 endpoint.getHL7V2RestClient
(int thePort) Gets an HL7V2 REST client for interacting with the CDR's HL7V2 endpoint on a specific port.getHL7V2RestClient
(String theModuleId) Gets an HL7V2 REST client for a specific module.Gets an outbound SMART client for OAuth 2.0 authorization flows.getOutboundSmartClient
(int thePort) Gets an outbound SMART client for OAuth 2.0 authorization flows on a specific port.getOutboundSmartClient
(String theModuleId) Gets an outbound SMART client for OAuth 2.0 authorization flows for a specific module.Gets a FHIR client with superuser privileges.getSuperuserFhirClient
(int thePort) Gets a FHIR client with superuser privileges on a specific port.getSuperuserFhirClient
(String theModuleId) Gets a FHIR client with superuser privileges for a specific module.
-
Method Details
-
getAdminJsonClient
Gets an administrative JSON client for interacting with the CDR's admin API. This will create anAdminJsonRestClient
with the first available ADMIN_JSON module u- Returns:
- An autodiscovered AdminJsonRestClient.
-
getAdminJsonClient
Gets anAdminJsonRestClient
for interacting with the CDR's admin API on a specific port.- Parameters:
thePort
- The port to connect to- Returns:
- The admin JSON client configured with the specified port
-
getSuperuserFhirClient
Gets a FHIR client with superuser privileges. This will create anIGenericClient
with the first available FHIR_ENDPOINT module- Returns:
- The FHIR client with superuser authentication
-
getSuperuserFhirClient
Gets a FHIR client with superuser privileges on a specific port.- Parameters:
thePort
- The port to connect to- Returns:
- The FHIR client with superuser authentication on the specified port
-
getSuperuserFhirClient
Gets a FHIR client with superuser privileges for a specific module.- Parameters:
theModuleId
- The ID of the module to connect to- Returns:
- The FHIR client with superuser authentication for the specified module
-
getFhirClient
Gets a standard FHIR client.- Returns:
- The FHIR client with default authentication
-
getFhirClient
Gets a standard FHIR client on a specific port.- Parameters:
thePort
- The port to connect to- Returns:
- The FHIR client with default authentication on the specified port
-
getFhirClient
Gets a standard FHIR client for a specific module.- Parameters:
theModuleId
- The ID of the module to connect to- Returns:
- The FHIR client with default authentication for the specified module
-
getFhirContext
Gets the FHIR context used by this harness.- Returns:
- The FHIR context
-
getFhirContext
Gets the FHIR context for a specific module.- Parameters:
moduleId
- The ID of the module- Returns:
- The FHIR context for the specified module
-
getHL7V2RestClient
Gets an HL7V2 REST client for interacting with the CDR's HL7V2 endpoint.- Returns:
- The HL7V2 REST client configured with default port
-
getHL7V2RestClient
Gets an HL7V2 REST client for interacting with the CDR's HL7V2 endpoint on a specific port.- Parameters:
thePort
- The port to connect to- Returns:
- The HL7V2 REST client configured with the specified port
-
getHL7V2RestClient
Gets an HL7V2 REST client for a specific module.- Parameters:
theModuleId
- The ID of the module to connect to- Returns:
- The HL7V2 REST client for the specified module
-
getOutboundSmartClient
Gets an outbound SMART client for OAuth 2.0 authorization flows. This will create an OutboundSmartClient targeting the first available SMART endpoint module.- Returns:
- The outbound SMART client configured with default endpoint
-
getOutboundSmartClient
Gets an outbound SMART client for OAuth 2.0 authorization flows on a specific port.- Parameters:
thePort
- The port to connect to- Returns:
- The outbound SMART client configured with the specified port
-
getOutboundSmartClient
Gets an outbound SMART client for OAuth 2.0 authorization flows for a specific module.- Parameters:
theModuleId
- The ID of the module to connect to- Returns:
- The outbound SMART client for the specified module
-