java.lang.Object
java.lang.Record
com.renomad.minum.web.FunctionalTesting.TestResponse
- Enclosing class:
FunctionalTesting
public static record FunctionalTesting.TestResponse(StatusLine statusLine, Headers headers, Body body)
extends Record
A
Response
designed to work with FunctionalTesting
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTestResponse
(StatusLine statusLine, Headers headers, Body body) Creates an instance of aTestResponse
record class. -
Method Summary
Modifier and TypeMethodDescriptionbody()
Returns the value of thebody
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.headers()
Returns the value of theheaders
record component.Presuming the response body is HTML, search for all HTML elements with the given tag name and attributes.Presuming the response body is HTML, search for a single HTML element with the given tag name and attributes.Returns the value of thestatusLine
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
TestResponse
Creates an instance of aTestResponse
record class.- Parameters:
statusLine
- the value for thestatusLine
record componentheaders
- the value for theheaders
record componentbody
- the value for thebody
record component
-
-
Method Details
-
searchOne
Presuming the response body is HTML, search for a single HTML element with the given tag name and attributes.- Returns:
HtmlParseNode.EMPTY
if none found, a particular node if found, and an exception thrown if more than one found.
-
search
Presuming the response body is HTML, search for all HTML elements with the given tag name and attributes.- Returns:
- a list of however many elements matched
-
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
public final int 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)
. -
statusLine
Returns the value of thestatusLine
record component.- Returns:
- the value of the
statusLine
record component
-
headers
Returns the value of theheaders
record component.- Returns:
- the value of the
headers
record component
-
body
Returns the value of thebody
record component.- Returns:
- the value of the
body
record component
-