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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTestResponse(StatusLine statusLine, Headers headers, Body body) Creates an instance of aTestResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionbody()Returns the value of thebodyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.headers()Returns the value of theheadersrecord 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 thestatusLinerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
TestResponse
Creates an instance of aTestResponserecord class.- Parameters:
statusLine- the value for thestatusLinerecord componentheaders- the value for theheadersrecord componentbody- the value for thebodyrecord 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.EMPTYif 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 thestatusLinerecord component.- Returns:
- the value of the
statusLinerecord component
-
headers
Returns the value of theheadersrecord component.- Returns:
- the value of the
headersrecord component
-
body
Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-