Package ca.cdr.test.app.harness.api
Record Class HarnessContext
java.lang.Object
java.lang.Record
ca.cdr.test.app.harness.api.HarnessContext
- Record Components:
protocol
- The connection protocol. Values are `http` or `https`baseUrl
- The base URL of the Smile CDR instance, e.g. `127.0.0.1` or `localhost`jsonAdminPort
- The port number for the administrative JSON API. If null, will attempt to auto-discover based on the properties file.username
- The username for authenticationpassword
- The password for authentication
public record HarnessContext(String protocol, String baseUrl, @Nullable Integer jsonAdminPort, String username, String password)
extends Record
Record class that holds configuration information for connecting to a Smile CDR instance.
This context can be used by
SmileHarness
implementations to establish connections to the CDR.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbaseUrl()
Returns the value of thebaseUrl
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thejsonAdminPort
record component.static HarnessContext
Factory method that creates a default HarnessContext for connecting to a local Smile CDR instance.password()
Returns the value of thepassword
record component.protocol()
Returns the value of theprotocol
record component.final String
toString()
Returns a string representation of this record class.username()
Returns the value of theusername
record component.
-
Constructor Details
-
HarnessContext
public HarnessContext(String protocol, String baseUrl, @Nullable Integer jsonAdminPort, String username, String password) Creates an instance of aHarnessContext
record class.- Parameters:
protocol
- the value for theprotocol
record componentbaseUrl
- the value for thebaseUrl
record componentjsonAdminPort
- the value for thejsonAdminPort
record componentusername
- the value for theusername
record componentpassword
- the value for thepassword
record component
-
-
Method Details
-
oobeHarnessContext
Factory method that creates a default HarnessContext for connecting to a local Smile CDR instance. This method provides predefined values for a standard out-of-box-experience (OOBE) setup. If you haven't provided a custom properties file, this harness context should be used. If you have customized users/endpoints, you should build your own HarnessContext.- Returns:
- A HarnessContext configured with default values for localhost connection
-
getContextRoot
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
protocol
Returns the value of theprotocol
record component.- Returns:
- the value of the
protocol
record component
-
baseUrl
Returns the value of thebaseUrl
record component.- Returns:
- the value of the
baseUrl
record component
-
jsonAdminPort
Returns the value of thejsonAdminPort
record component.- Returns:
- the value of the
jsonAdminPort
record component
-
username
Returns the value of theusername
record component.- Returns:
- the value of the
username
record component
-
password
Returns the value of thepassword
record component.- Returns:
- the value of the
password
record component
-