signature:
public class RestAssuredMockMvc { /** * Perform a HEAD request to a < code > path < / code > . Normally the path doesn ' t have to be fully - qualified e . g . you don ' t need to
 * specify the path as < tt > http : / / localhost : 8080 / path < / tt > . In this case it ' s enough to use < tt > / path < / tt > .
 * @ param path The path to send the request to .
 * @ param pathParams The path parameters . E . g . if path is " / book / { hotelId } / { roomNumber } " you can do < code > head ( " / book / { hotelName } / { roomNumber } " , " Hotels R Us " , 22 ) ; < / code > .
 * @ return The response of the request . */
public static MockMvcResponse head ( String path , Object ... pathParams ) { } }

implementation: return given ( ) . head ( path , pathParams ) ;


signature:
public class RestAssuredMockMvc { /** * Perform a HEAD request to a < code > path < / code > . Normally the path doesn ' t have to be fully - qualified e . g . you don ' t need to
 * specify the path as < tt > http : / / localhost : 8080 / path < / tt > . In this case it ' s enough to use < tt > / path < / tt > .
 * @ param path The path to send the request to .
 * @ param pathParams The path parameters .
 * @ return The response of the request . */
public static MockMvcResponse head ( String path , Map < String , ? > pathParams ) { } }


signature:
public class RestAssuredMockMvc { /** * Perform a PATCH request to a < code > path < / code > . Normally the path doesn ' t have to be fully - qualified e . g . you don ' t need to
 * specify the path as < tt > http : / / localhost : 8080 / path < / tt > . In this case it ' s enough to use < tt > / path < / tt > .
 * @ param path The path to send the request to .
 * @ param pathParams The path parameters . E . g . if path is " / book / { hotelId } / { roomNumber } " you can do < code > head ( " / book / { hotelName } / { roomNumber } " , " Hotels R Us " , 22 ) ; < / code > .
 * @ return The response of the request . */
public static MockMvcResponse patch ( String path , Object ... pathParams ) { } }

implementation: return given ( ) . patch ( path , pathParams ) ;


signature:
public class RestAssuredMockMvc { /** * Perform a PATCH request to a < code > path < / code > . Normally the path doesn ' t have to be fully - qualified e . g . you don ' t need to
 * specify the path as < tt > http : / / localhost : 8080 / path < / tt > . In this case it ' s enough to use < tt > / path < / tt > .
 * @ param path The path to send the request to .
 * @ param pathParams The path parameters .
 * @ return The response of the request . */
public static MockMvcResponse patch ( String path , Map < String , ? > pathParams ) { } }


signature:
public class RestAssuredMockMvc { /** * Perform a OPTIONS request to a < code > path < / code > . Normally the path doesn ' t have to be fully - qualified e . g . you don ' t need to
 * specify the path as < tt > http : / / localhost : 8080 / path < / tt > . In this case it ' s enough to use < tt > / path < / tt > .
 * @ param path The path to send the request to .
 * @ param pathParams The path parameters . E . g . if path is " / book / { hotelId } / { roomNumber } " you can do < code > head ( " / book / { hotelName } / { roomNumber } " , " Hotels R Us " , 22 ) ; < / code > .
 * @ return The response of the request . */
public static MockMvcResponse options ( String path , Object ... pathParams ) { } }

implementation: return given ( ) . options ( path , pathParams ) ;


signature:
public class RestAssuredMockMvc { /** * Perform a OPTIONS request to a < code > path < / code > . Normally the path doesn ' t have to be fully - qualified e . g . you don ' t need to
 * specify the path as < tt > http : / / localhost : 8080 / path < / tt > . In this case it ' s enough to use < tt > / path < / tt > .
 * @ param path The path to send the request to .
 * @ param pathParams The path parameters .
 * @ return The response of the request . */
public static MockMvcResponse options ( String path , Map < String , ? > pathParams ) { } }


signature:
public class RestAssuredMockMvc { /** * Perform a request to a < code > uri < / code > .
 * @ param method The HTTP method to use
 * @ param uri The uri to send the request to .
 * @ return The response of the GET request . */
public static MockMvcResponse request ( Method method , URI uri ) { } }

implementation: return given ( ) . request ( method , uri ) ;


signature:
public class RestAssuredMockMvc { /** * Perform a request to a < code > url < / code > .
 * @ param method The HTTP method to use
 * @ param url The url to send the request to .
 * @ return The response of the GET request . */
public static MockMvcResponse request ( Method method , URL url ) { } }

implementation: return given ( ) . request ( method , url ) ;


signature:
public class RestAssuredMockMvc { /** * Perform a custom HTTP request to a < code > uri < / code > .
 * @ param method The HTTP method to use
 * @ param uri The uri to send the request to .
 * @ return The response of the GET request . */
public static MockMvcResponse request ( String method , URI uri ) { } }


signature:
public class RestAssuredMockMvc { /** * Perform a custom HTTP request to a < code > url < / code > .
 * @ param method The HTTP method to use
 * @ param url The url to send the request to .
 * @ return The response of the GET request . */
public static MockMvcResponse request ( String method , URL url ) { } }


signature:
public class RestAssuredMockMvc { /** * Authenticate using the given principal . Used as :
 * < pre >
 * RestAssured . authentication = principal ( myPrincipal ) ;
 * < / pre >
 * or in a { @ link MockMvcRequestSpecBuilder } :
 * < pre >
 * MockMvcRequestSpecification req = new MockMvcRequestSpecBuilder ( ) . setAuth ( principal ( myPrincipal ) ) . . .
 * < / pre >
 * @ param principal The principal to use .
 * @ return A { @ link MockMvcAuthenticationScheme } instance .
 * @ see MockMvcAuthenticationSpecification # principal ( java . security . Principal ) */
public static MockMvcAuthenticationScheme principal ( final Principal principal ) { } }

implementation: return new MockMvcAuthenticationScheme ( ) { public void authenticate ( MockMvcRequestSpecification mockMvcRequestSpecification ) { mockMvcRequestSpecification . auth ( ) . principal ( principal ) ; } } ;


signature:
public class RestAssuredMockMvc { /** * Authenticate using the given principal . Used as :
 * < pre >
 * RestAssured . authentication = principal ( myPrincipal ) ;
 * < / pre >
 * or in a { @ link MockMvcRequestSpecBuilder } :
 * < pre >
 * MockMvcRequestSpecification req = new MockMvcRequestSpecBuilder ( ) . setAuth ( principal ( myPrincipal ) ) . . .
 * < / pre >
 * @ param principal The principal to use .
 * @ return A { @ link MockMvcAuthenticationScheme } instance .
 * @ see MockMvcAuthenticationSpecification # principal ( Object ) */
public static MockMvcAuthenticationScheme principal ( final Object principal ) { } }


signature:
public class RestAssuredMockMvc { /** * Authenticate using the given principal and credentials . Used as :
 * < pre >
 * RestAssured . authentication = principalWithCredentials ( myPrincipal , myCredentials ) ;
 * < / pre >
 * or in a { @ link MockMvcRequestSpecBuilder } :
 * < pre >
 * MockMvcRequestSpecification req = new MockMvcRequestSpecBuilder ( ) . setAuth ( principalWithCredentials ( myPrincipal , myCredentials ) ) . . .
 * < / pre >
 * @ param principal The principal to use .
 * @ param credentials The credentials to use
 * @ param authorities Optional list of authorities
 * @ return A { @ link MockMvcAuthenticationScheme } instance .
 * @ see MockMvcAuthenticationSpecification # principalWithCredentials ( Object , Object , String . . . ) */
public static MockMvcAuthenticationScheme principalWithCredentials ( final Object principal , final Object credentials , final String ... authorities ) { } }

implementation: return new MockMvcAuthenticationScheme ( ) { public void authenticate ( MockMvcRequestSpecification mockMvcRequestSpecification ) { mockMvcRequestSpecification . auth ( ) . principalWithCredentials ( principal , credentials , authorities ) ; } } ;


signature:
public class RestAssuredMockMvc { /** * Authenticate using the supplied authentication instance ( < code > org . springframework . security . core . Authentication < / code > from Spring Security ) . Used as :
 * < pre >
 * RestAssured . authentication = authentication ( myAuth ) ;
 * < / pre >
 * or in a { @ link MockMvcRequestSpecBuilder } :
 * < pre >
 * MockMvcRequestSpecification req = new MockMvcRequestSpecBuilder ( ) . setAuth ( authentication ( myAuth ) ) . . .
 * < / pre >
 * @ param authentication The authentication instance to use .
 * @ return A { @ link MockMvcAuthenticationScheme } instance .
 * @ see MockMvcAuthenticationSpecification # authentication ( Object ) */
public static MockMvcAuthenticationScheme authentication ( final Object authentication ) { } }

implementation: return new MockMvcAuthenticationScheme ( ) { public void authenticate ( MockMvcRequestSpecification mockMvcRequestSpecification ) { mockMvcRequestSpecification . auth ( ) . authentication ( authentication ) ; } } ;


signature:
public class RestAssuredMockMvc { /** * Authenticate using a { @ link RequestPostProcessor } .
 * This is mainly useful when you have added the < code > spring - security - test < / code > artifact to classpath . This allows
 * you to do for example :
 * < pre >
 * RestAssured . authentication = with ( user ( " username " ) . password ( " password " ) ) ;
 * < / pre >
 * where < code > user < / code > is statically imported from < code > org . springframework . security . test . web . servlet . request . SecurityMockMvcRequestPostProcessors < / code > .
 * @ param requestPostProcessor The first request post processor to be used for authentication
 * @ param additionalRequestPostProcessor Additional request post processors to be used for authentication
 * @ return A { @ link MockMvcAuthenticationScheme } instance . */
public static MockMvcAuthenticationScheme with ( final RequestPostProcessor requestPostProcessor , final RequestPostProcessor ... additionalRequestPostProcessor ) { } }

implementation: return new MockMvcAuthenticationScheme ( ) { public void authenticate ( MockMvcRequestSpecification mockMvcRequestSpecification ) { mockMvcRequestSpecification . auth ( ) . with ( requestPostProcessor , additionalRequestPostProcessor ) ; } } ;


signature:
public class RestAssuredMockMvc { /** * Enable logging of both the request and the response if REST Assureds test validation fails with the specified log detail .
 * This is just a shortcut for :
 * < pre >
 * RestAssured . config = new RestAssuredMockMvcConfig ( ) . logConfig ( logConfig ( ) . enableLoggingOfRequestAndResponseIfValidationFails ( logDetail ) ) ;
 * < / pre >
 * @ param logDetail The log detail to show in the log */
public static void enableLoggingOfRequestAndResponseIfValidationFails ( LogDetail logDetail ) { } }

implementation:
config = config == null ? new RestAssuredMockMvcConfig ( ) : config ; config = config . logConfig ( logConfig ( ) . enableLoggingOfRequestAndResponseIfValidationFails ( logDetail ) ) ; // Update request specification if already defined otherwise it ' ll override the configs .
// Note that request spec also influence response spec when it comes to logging if validation fails due to the way filters work
if ( requestSpecification != null && requestSpecification instanceof MockMvcRequestSpecificationImpl ) { RestAssuredMockMvcConfig restAssuredConfig = ( ( MockMvcRequestSpecificationImpl ) requestSpecification ) . getRestAssuredMockMvcConfig ( ) ; if ( restAssuredConfig == null ) { restAssuredConfig = config ; } else { LogConfig logConfigForRequestSpec = restAssuredConfig . getLogConfig ( ) . enableLoggingOfRequestAndResponseIfValidationFails ( logDetail ) ; restAssuredConfig = restAssuredConfig . logConfig ( logConfigForRequestSpec ) ; } requestSpecification . config ( restAssuredConfig ) ; }


signature:
public class RestAssuredMockMvcMatchers { /** * Creates a { @ link ResponseAwareMatcher } that extracts the given path from the response and
 * wraps it in a { @ link org . hamcrest . Matchers # equalTo ( Object ) } matcher . This is useful if you have a resource that e . g . returns the given JSON :
 * < pre >
 * " userId " : " my - id " ,
 * " playerId " : " my - id "
 * < / pre >
 * you can then test it like this :
 * < pre >
 * get ( " / x " ) . then ( ) . body ( " userId " , equalToPath ( " playerId " ) ) ;
 * < / pre >
 * @ param path The path to check
 * @ return A { @ link ResponseAwareMatcher } */
public static ResponseAwareMatcher < MockMvcResponse > equalToPath ( final String path ) { } }

implementation: return new ResponseAwareMatcher < MockMvcResponse > ( ) { public Matcher < ? > matcher ( MockMvcResponse response ) { return equalTo ( response . path ( path ) ) ; } } ;


signature:
public class RestAssuredMockMvcMatchers { /** * Creates a { @ link ResponseAwareMatcher } that extracts the given path from the response and
 * wraps it in a { @ link org . hamcrest . Matchers # equalTo ( Object ) } matcher . This is useful if you have a resource that e . g . returns the given JSON :
 * < pre >
 * " userId " : " my - id " ,
 * " href " : " http : / / localhost : 8080 / my - id "
 * < / pre >
 * you can then test it like this :
 * < pre >
 * get ( " / x " ) . then ( ) . body ( " href " , endsWithPath ( " userId " ) ) ;
 * < / pre >
 * @ param path The path to check
 * @ return A { @ link ResponseAwareMatcher } */
public static ResponseAwareMatcher < MockMvcResponse > endsWithPath ( final String path ) { } }

implementation: return new ResponseAwareMatcher < MockMvcResponse > ( ) { public Matcher < ? > matcher ( MockMvcResponse response ) { return endsWith ( response . < String > path ( path ) ) ; } } ;


signature:
public class RestAssuredMockMvcMatchers { /** * Creates a { @ link ResponseAwareMatcher } that extracts the given path from the response and
 * wraps it in a { @ link org . hamcrest . Matchers # equalTo ( Object ) } matcher . This is useful if you have a resource that e . g . returns the given JSON :
 * < pre >
 * " userId " : " my - id " ,
 * " baseUri " : " http : / / localhost : 8080 " ,
 * " href " : " http : / / localhost : 8080 / my - id "
 * < / pre >
 * you can then test it like this :
 * < pre >
 * get ( " / x " ) . then ( ) . body ( " href " , startsWithPath ( " baseUri " ) ) ;
 * < / pre >
 * @ param path The path to check
 * @ return A { @ link ResponseAwareMatcher } */
public static ResponseAwareMatcher < MockMvcResponse > startsWithPath ( final String path ) { } }

implementation: return new ResponseAwareMatcher < MockMvcResponse > ( ) { public Matcher < ? > matcher ( MockMvcResponse response ) { return startsWith ( response . < String > path ( path ) ) ; } } ;


signature:
public class RestAssuredMockMvcMatchers { /** * Creates a { @ link ResponseAwareMatcher } that extracts the given path from the response and
 * wraps it in a { @ link org . hamcrest . Matchers # equalTo ( Object ) } matcher . This is useful if you have a resource that e . g . returns the given JSON :
 * < pre >
 * " userId " : " my - id " ,
 * " href " : " http : / / localhost : 8080 / my - id "
 * < / pre >
 * you can then test it like this :
 * < pre >
 * get ( " / x " ) . then ( ) . body ( " href " , containsPath ( " userId " ) ) ;
 * < / pre >
 * @ param path The path to check
 * @ return A { @ link ResponseAwareMatcher } */
public static ResponseAwareMatcher < MockMvcResponse > containsPath ( final String path ) { } }

implementation: return new ResponseAwareMatcher < MockMvcResponse > ( ) { public Matcher < ? > matcher ( MockMvcResponse response ) { return containsString ( response . < String > path ( path ) ) ; } } ;


signature:
public class ResponseBuilder { /** * Set the content type of the response
 * @ return The builder */
public ResponseBuilder setContentType ( String contentType ) { } }

implementation: notNull ( contentType , "Content type" ) ; restAssuredResponse . setContentType ( contentType ) ; setHeader ( CONTENT_TYPE , contentType ) ; return this ;


signature:
public class ResponseBuilder { /** * Set the content type of the response
 * @ return The builder */
public ResponseBuilder setContentType ( ContentType contentType ) { } }

implementation: notNull ( contentType , ContentType . class ) ; return setContentType ( contentType . toString ( ) ) ;


signature:
public class ResponseBuilder { /** * Set a specific header
 * @ return The builder */
public ResponseBuilder setHeader ( String name , String value ) { } }

implementation: notNull ( name , "Header name" ) ; notNull ( value , "Header value" ) ; List < Header > newHeaders = new ArrayList < Header > ( restAssuredResponse . headers ( ) . asList ( ) ) ; newHeaders . add ( new Header ( name , value ) ) ; restAssuredResponse . setResponseHeaders ( new Headers ( newHeaders ) ) ; if ( trim ( name ) . equalsIgnoreCase ( CONTENT_TYPE ) ) { restAssuredResponse . setContentType ( value ) ; } return this ;


signature:
public class ResponseBuilder { /** * Build the actual response
 * @ return The response object */
public Response build ( ) { } }

implementation: final int statusCode = restAssuredResponse . statusCode ( ) ; if ( statusCode < 100 || statusCode >= 600 ) { throw new IllegalArgumentException ( format ( "Status code must be greater than 100 and less than 600, was %d." , statusCode ) ) ; } if ( StringUtils . isBlank ( restAssuredResponse . statusLine ( ) ) ) { restAssuredResponse . setStatusLine ( restAssuredResponse . statusCode ( ) ) ; } restAssuredResponse . setRpr ( new ResponseParserRegistrar ( ) ) ; return restAssuredResponse ;


signature:
public class DetailedCookieMatcher { /** * Verifies whether value of cookie satisfies specified matcher .
 * @ param valueMatcher value assertion
 * @ return A { @ link DetailedCookieMatcher } instance with and - composed value property assertion */
public DetailedCookieMatcher value ( Matcher < ? super String > valueMatcher ) { } }

implementation: return new DetailedCookieMatcher ( and ( Matchers . hasProperty ( "value" , valueMatcher ) ) ) ;


signature:
public class DetailedCookieMatcher { /** * Verifies whether comment of cookie satisfies specified matcher .
 * @ param commentMatcher comment assertion
 * @ return A { @ link DetailedCookieMatcher } instance with and - composed comment property assertion */
public DetailedCookieMatcher comment ( Matcher < ? super String > commentMatcher ) { } }

implementation: return new DetailedCookieMatcher ( and ( Matchers . hasProperty ( "comment" , commentMatcher ) ) ) ;


signature:
public class DetailedCookieMatcher { /** * Verifies whether expiry date of cookie satisfies specified matcher .
 * @ param expiryDateMatcher expiry date assertion
 * @ return A { @ link DetailedCookieMatcher } instance with and - composed expiry date property assertion */
public DetailedCookieMatcher expiryDate ( Matcher < ? super Date > expiryDateMatcher ) { } }

implementation: return new DetailedCookieMatcher ( and ( Matchers . hasProperty ( "expiryDate" , expiryDateMatcher ) ) ) ;


signature:
public class DetailedCookieMatcher { /** * Verifies whether domain of cookie satisfies specified matcher .
 * @ param domainMatcher assertion for domain property
 * @ return A { @ link DetailedCookieMatcher } instance with and - composed domain property assertion */
public DetailedCookieMatcher domain ( Matcher < ? super String > domainMatcher ) { } }

implementation: return new DetailedCookieMatcher ( and ( Matchers . hasProperty ( "domain" , domainMatcher ) ) ) ;


signature:
public class DetailedCookieMatcher { /** * Verifies whether path of cookie satisfies specified matcher .
 * @ param pathMatcher assertion for path property
 * @ return A { @ link DetailedCookieMatcher } instance with and - composed path property assertion */
public DetailedCookieMatcher path ( Matcher < ? super String > pathMatcher ) { } }

implementation: return new DetailedCookieMatcher ( and ( Matchers . hasProperty ( "path" , pathMatcher ) ) ) ;


signature:
public class DetailedCookieMatcher { /** * Verifies whether secured property of cookie satisfies specified matcher .
 * @ param securedMatcher assertion for secured property
 * @ return A { @ link DetailedCookieMatcher } instance with and - composed secured property assertion */
public DetailedCookieMatcher secured ( Matcher < ? super Boolean > securedMatcher ) { } }

implementation: return new DetailedCookieMatcher ( and ( Matchers . hasProperty ( "secured" , securedMatcher ) ) ) ;


signature:
public class DetailedCookieMatcher { /** * Verifies whether http - only property of cookie satisfies specified matcher .
 * @ param httpOnlyMatcher assertion for domain property
 * @ return A { @ link DetailedCookieMatcher } instance with and - composed http - only property assertion */
public DetailedCookieMatcher httpOnly ( Matcher < ? super Boolean > httpOnlyMatcher ) { } }

implementation: return new DetailedCookieMatcher ( and ( Matchers . hasProperty ( "httpOnly" , httpOnlyMatcher ) ) ) ;


signature:
public class DetailedCookieMatcher { /** * Verifies whether version of cookie satisfies specified matcher .
 * @ param versionMatcher assertion for version property
 * @ return A { @ link DetailedCookieMatcher } instance with and - composed version property assertion */
public DetailedCookieMatcher version ( Matcher < ? super Integer > versionMatcher ) { } }

implementation: return new DetailedCookieMatcher ( and ( Matchers . hasProperty ( "version" , versionMatcher ) ) ) ;


signature:
public class DetailedCookieMatcher { /** * Verifies whether max age of cookie satisfies specified matcher .
 * @ param maxAgeMatcher assertion for max age property
 * @ return A { @ link DetailedCookieMatcher } instance with and - composed max age property assertion */
public DetailedCookieMatcher maxAge ( Matcher < ? super Integer > maxAgeMatcher ) { } }

implementation: return new DetailedCookieMatcher ( and ( Matchers . hasProperty ( "maxAge" , maxAgeMatcher ) ) ) ;


signature:
public class ResponseSpecBuilder { /** * Expect that a response header matches the supplied header name and hamcrest matcher .
 * @ param headerName The name of the expected header
 * @ param expectedValueMatcher The Hamcrest matcher that must conform to the value
 * @ return The builder */
public ResponseSpecBuilder expectHeader ( String headerName , Matcher < String > expectedValueMatcher ) { } }

implementation: spec . header ( headerName , expectedValueMatcher ) ; return this ;


signature:
public class ResponseSpecBuilder { /** * Expect that a response header matches the supplied name and value .
 * @ param headerName The name of the expected header
 * @ param expectedValue The value of the expected header
 * @ return The builder */
public ResponseSpecBuilder expectHeader ( String headerName , String expectedValue ) { } }

implementation: spec . header ( headerName , expectedValue ) ; return this ;


signature:
public class ResponseSpecBuilder { /** * Expect that a response cookie matches the supplied cookie name and hamcrest matcher .
 * E . g . < tt > cookieName1 = cookieValue1 < / tt >
 * @ param cookieName The name of the expected cookie
 * @ param expectedValueMatcher The Hamcrest matcher that must conform to the value
 * @ return The builder */
public ResponseSpecBuilder expectCookie ( String cookieName , Matcher < String > expectedValueMatcher ) { } }

implementation: spec . cookie ( cookieName , expectedValueMatcher ) ; return this ;


signature:
public class ResponseSpecBuilder { /** * Expect that a detailed response cookie matches the supplied cookie name and hamcrest matcher ( see { @ link DetailedCookieMatcher } .
 * E . g . expect that the response of the GET request to " / something " contain cookie < tt > cookieName1 = cookieValue1 < / tt >
 * < pre >
 * expectCookie ( " cookieName1 " , detailedCookie ( ) . value ( " cookieValue1 " ) . secured ( true ) ) ;
 * < / pre >
 * You can also expect several cookies :
 * < pre >
 * expectCookie ( " cookieName1 " , detailedCookie ( ) . value ( " cookieValue1 " ) . secured ( true ) )
 * . expectCookie ( " cookieName2 " , detailedCookie ( ) . value ( " cookieValue2 " ) . secured ( false ) ) ;
 * < / pre >
 * @ param cookieName The name of the expected cookie
 * @ param detailedCookieMatcher The Hamcrest matcher that must conform to the cookie
 * @ return The builder */
public ResponseSpecBuilder expectCookie ( String cookieName , DetailedCookieMatcher detailedCookieMatcher ) { } }

implementation: spec . cookie ( cookieName , detailedCookieMatcher ) ; return this ;


signature:
public class ResponseSpecBuilder { /** * Expect that a response cookie matches the supplied name and value .
 * @ param cookieName The name of the expected cookie
 * @ param expectedValue The value of the expected cookie
 * @ return The builder */
public ResponseSpecBuilder expectCookie ( String cookieName , String expectedValue ) { } }

implementation: spec . cookie ( cookieName , expectedValue ) ; return this ;


signature:
public class ResponseSpecBuilder { /** * Validate that the response time matches the supplied < code > matcher < / code > and time unit .
 * @ param matcher The matcher
 * @ param timeUnit The timeout
 * @ return the builder */
public ResponseSpecBuilder expectResponseTime ( Matcher < Long > matcher , TimeUnit timeUnit ) { } }

implementation: spec . time ( matcher , timeUnit ) ; return this ;


signature:
public class ResponseSpecBuilder { /** * Set the root path of the response body so that you don ' t need to write the entire path for each expectation . The same as { @ link # rootPath ( String ) }
 * but also provides a way to defined arguments .
 * @ param rootPath The root path to use .
 * @ param arguments The arguments .
 * @ see ResponseSpecification # root ( String , java . util . List ) */
public ResponseSpecBuilder rootPath ( String rootPath , List < Argument > arguments ) { } }

implementation: spec . root ( rootPath , arguments ) ; return this ;


signature:
public class ResponseSpecBuilder { /** * Append the given path to the root path with arguments supplied of the response body so that you don ' t need to write the entire path for each expectation .
 * This is mainly useful when you have parts of the path defined in variables .
 * E . g . instead of writing :
 * < pre >
 * String namePath = " name " ;
 * expect ( ) .
 * root ( " x . y " ) .
 * body ( " age " , is ( . . ) ) .
 * body ( " gender " , is ( . . ) ) .
 * body ( namePath + " first " , is ( . . ) ) .
 * body ( namePath + " last " , is ( . . ) ) .
 * when ( ) .
 * get ( . . ) ;
 * < / pre >
 * you can use a append root and do :
 * < pre >
 * String namePath = " name " ;
 * expect ( ) .
 * root ( " x . y " ) .
 * body ( " age " , is ( . . ) ) .
 * body ( " gender " , is ( . . ) ) .
 * appendRoot ( " % s " , withArgs ( namePath ) ) .
 * body ( " first " , is ( . . ) ) .
 * body ( " last " , is ( . . ) ) .
 * when ( ) .
 * get ( . . ) ;
 * < / pre >
 * @ param pathToAppend The root path to use . The path and arguments follows the standard < a href = " http : / / download . oracle . com / javase / 1,5.0 / docs / api / java / util / Formatter . html # syntax " > formatting syntax < / a > of Java . */
public ResponseSpecBuilder appendRootPath ( String pathToAppend , List < Argument > arguments ) { } }

implementation: spec . appendRootPath ( pathToAppend , arguments ) ; return this ;


signature:
public class ResponseSpecBuilder { /** * Expect that the JSON or XML response content conforms to one or more Hamcrest matchers . < br >
 * < h3 > JSON example < / h3 >
 * Assume that a GET request to " / lotto " returns a JSON response containing :
 * < pre >
 * { " lotto " : {
 * " lottoId " : 5,
 * " winning - numbers " : [ 2,45,34,23,7,5,3 ] ,
 * " winners " : [ {
 * " winnerId " : 23,
 * " numbers " : [ 2,45,34,23,3,5]
 * " winnerId " : 54,
 * " numbers " : [ 52,3,12,11,18,22]
 * < / pre >
 * You can verify that the lottoId is equal to 5 like this :
 * < pre >
 * ResponseSpecBuilder builder = new ResponseSpecBuilder ( ) ;
 * builder . expectBody ( " lotto . lottoId " , equalTo ( 5 ) ) ;
 * < / pre >
 * @ param matcher The hamcrest matcher that the response content must match .
 * @ return The builder */
public ResponseSpecBuilder expectBody ( String path , Matcher < ? > matcher ) { } }

implementation: spec . body ( path , matcher ) ; return this ;


signature:
public class ResponseSpecBuilder { /** * Same as { @ link # expectBody ( String , org . hamcrest . Matcher ) } expect that you can pass arguments to the path . This
 * is useful in situations where you have e . g . pre - defined variables that constitutes the path :
 * < pre >
 * String someSubPath = " else " ;
 * int index = 1;
 * expect ( ) . body ( " something . % s [ % d ] " , withArgs ( someSubPath , index ) , equalTo ( " some value " ) ) . . .
 * < / pre >
 * or if you have complex root paths and don ' t wish to duplicate the path for small variations :
 * < pre >
 * expect ( ) .
 * root ( " filters . filterConfig [ % d ] . filterConfigGroups . find { it . name = = ' Gold ' } . includes " ) .
 * body ( withArgs ( 0 ) , hasItem ( " first " ) ) .
 * body ( withArgs ( 1 ) , hasItem ( " second " ) ) .
 * < / pre >
 * The path and arguments follows the standard < a href = " http : / / download . oracle . com / javase / 1,5.0 / docs / api / java / util / Formatter . html # syntax " > formatting syntax < / a > of Java .
 * Note that < code > withArgs < / code > can be statically imported from the < code > io . restassured . RestAssured < / code > class .
 * @ param path The body path
 * @ param matcher The hamcrest matcher that must response body must match .
 * @ return the response specification
 * @ see # expectBody ( String , org . hamcrest . Matcher ) */
public ResponseSpecBuilder expectBody ( String path , List < Argument > arguments , Matcher < ? > matcher ) { } }

implementation: spec . body ( path , arguments , matcher ) ; return this ;


signature:
public class ResponseSpecBuilder { /** * Merge this builder with settings from another specification . Note that the supplied specification
 * can overwrite data in the current specification . The following settings are overwritten :
 * < ul >
 * < li > Content type < / li >
 * < li > Root path < /
 * < li > Status code < / li >
 * < li > Status line < / li >
 * < / ul >
 * The following settings are merged :
 * < ul >
 * < li > Response body expectations < / li >
 * < li > Cookies < / li >
 * < li > Headers < / li >
 * < / ul >
 * @ param specification The specification the add .
 * @ return The builder */
public ResponseSpecBuilder addResponseSpecification ( ResponseSpecification specification ) { } }

implementation: if ( ! ( specification instanceof ResponseSpecificationImpl ) ) { throw new IllegalArgumentException ( "specification must be of type " + ResponseSpecificationImpl . class . getClass ( ) + "." ) ; } ResponseSpecificationImpl rs = ( ResponseSpecificationImpl ) specification ; SpecificationMerger . merge ( ( ResponseSpecificationImpl ) spec , rs ) ; return this ;


signature:
public class ResponseSpecBuilder { /** * Enabled logging with the specified log detail . Set a { @ link LogConfig } to configure the print stream and pretty printing options .
 * @ param logDetail The log detail .
 * @ return ResponseSpecBuilder */
public ResponseSpecBuilder log ( LogDetail logDetail ) { } }

implementation: notNull ( logDetail , LogDetail . class ) ; spec . logDetail ( logDetail ) ; return this ;


signature:
public class ResponseSpecBuilder { /** * Register a content - type to be parsed using a predefined parser . E . g . let ' s say you want parse
 * content - type < tt > application / vnd . uoml + xml < / tt > with the XML parser to be able to verify the response using the XML dot notations :
 * < pre >
 * expect ( ) . body ( " document . child " , equalsTo ( " something " ) ) . .
 * < / pre >
 * Since < tt > application / vnd . uoml + xml < / tt > is not registered to be processed by the XML parser by default you need to explicitly
 * tell REST Assured to use this parser before making the request :
 * < pre >
 * expect ( ) . parser ( " application / vnd . uoml + xml " , Parser . XML " ) . when ( ) . . . ;
 * < / pre >
 * You can also specify by default by using :
 * < pre >
 * RestAssured . registerParser ( " application / vnd . uoml + xml , Parser . XML " ) ;
 * < / pre >
 * @ param contentType The content - type to register
 * @ param parser The parser to use when verifying the response .
 * @ return The builder */
public ResponseSpecBuilder registerParser ( String contentType , Parser parser ) { } }

implementation: spec . parser ( contentType , parser ) ; return this ;


signature:
public class JsonSchemaValidator { /** * Creates a Hamcrest matcher that validates that a JSON document conforms to the JSON schema provided to this method .
 * @ param schema The string defining the JSON schema
 * @ return A Hamcrest matcher */
public static JsonSchemaValidator matchesJsonSchema ( String schema ) { } }

implementation: return new JsonSchemaValidatorFactory < String > ( ) { @ Override JsonNode createSchemaInstance ( String input ) throws IOException { return JsonLoader . fromString ( input ) ; } } . create ( schema ) ;


signature:
public class JsonSchemaValidator { /** * Creates a Hamcrest matcher that validates that a JSON document conforms to the JSON schema provided to this method .
 * @ param pathToSchemaInClasspath The string that points to a JSON schema in classpath .
 * @ return A Hamcrest matcher */
public static JsonSchemaValidator matchesJsonSchemaInClasspath ( String pathToSchemaInClasspath ) { } }

implementation: return matchesJsonSchema ( Thread . currentThread ( ) . getContextClassLoader ( ) . getResource ( pathToSchemaInClasspath ) ) ;


signature:
public class JsonSchemaValidator { /** * Creates a Hamcrest matcher that validates that a JSON document conforms to the JSON schema provided to this method .
 * @ param schema The reader that points to a JSON schema
 * @ return A Hamcrest matcher */
public static JsonSchemaValidator matchesJsonSchema ( Reader schema ) { } }

implementation: return new JsonSchemaValidatorFactory < Reader > ( ) { @ Override JsonNode createSchemaInstance ( Reader input ) throws IOException { return JsonLoader . fromReader ( input ) ; } } . create ( schema ) ;


signature:
public class JsonSchemaValidator { /** * Creates a Hamcrest matcher that validates that a JSON document conforms to the JSON schema provided to this method .
 * @ param file The file that points to a JSON schema
 * @ return A Hamcrest matcher */
public static JsonSchemaValidator matchesJsonSchema ( File file ) { } }

implementation: return new JsonSchemaValidatorFactory < File > ( ) { @ Override JsonNode createSchemaInstance ( File input ) throws IOException { return JsonLoader . fromFile ( input ) ; } } . create ( file ) ;


signature:
public class ResponseAwareMatcherComposer { /** * Compose this { @ link ResponseAwareMatcher } with another { @ link ResponseAwareMatcher } .
 * @ param matcher1 The first matcher to compose
 * @ param matcher2 The second matcher to compose
 * @ return A and - composed { @ link ResponseAwareMatcher } . */
@ SuppressWarnings ( "unchecked" ) public static < T extends ResponseBody < T > & ResponseOptions < T > > ResponseAwareMatcher < T > and ( final ResponseAwareMatcher < T > matcher1 , final ResponseAwareMatcher < T > matcher2 ) { } }

implementation: return and ( matcher1 , matcher2 , new ResponseAwareMatcher [ 0 ] ) ;


signature:
public class ResponseAwareMatcherComposer { /** * Compose this { @ link ResponseAwareMatcher } with another { @ link ResponseAwareMatcher } .
 * @ param matcher1 The first matcher to compose
 * @ param matcher2 The second matcher to compose
 * @ param additionalMatchers The additional matchers to compose
 * @ return A and - composed { @ link ResponseAwareMatcher } . */
@ SuppressWarnings ( "unchecked" ) public static < T extends ResponseBody < T > & ResponseOptions < T > > ResponseAwareMatcher < T > and ( final ResponseAwareMatcher < T > matcher1 , final ResponseAwareMatcher < T > matcher2 , final ResponseAwareMatcher < T > ... additionalMatchers ) { } }

implementation: return response -> { Matcher < ? > [ ] matchers = toHamcrestMatchers ( response , matcher1 , matcher2 , additionalMatchers ) ; return allOf ( ( Matcher < ? super Object > [ ] ) matchers ) ; } ;


signature:
public class ResponseAwareMatcherComposer { /** * Compose this { @ link ResponseAwareMatcher } with another { @ link ResponseAwareMatcher } .
 * @ param matcher1 The first matcher to compose
 * @ param matcher2 The second matcher to compose
 * @ param additionalMatchers The additional matchers to compose
 * @ return A or - composed { @ link ResponseAwareMatcher } . */
@ SuppressWarnings ( "unchecked" ) public static < T extends ResponseBody < T > & ResponseOptions < T > > ResponseAwareMatcher < T > or ( final ResponseAwareMatcher < T > matcher1 , final ResponseAwareMatcher < T > matcher2 , final ResponseAwareMatcher < T > ... additionalMatchers ) { } }

implementation: return response -> { Matcher < ? > [ ] matchers = toHamcrestMatchers ( response , matcher1 , matcher2 , additionalMatchers ) ; return anyOf ( ( Matcher < ? super Object > [ ] ) matchers ) ; } ;


signature:
public class MultiValueEntity { /** * Get a single entity with the supplied name . If there are several entities match the < code > entityName < / code > then
 * the last one is returned .
 * @ param entityName The name of the entity to find
 * @ return The found entity or < code > null < / code > if no entity was found . */
public T get ( String entityName ) { } }

implementation: notNull ( entityName , "Entity name" ) ; List < T > copyOfEntities = reverse ( ) ; for ( T entity : copyOfEntities ) { if ( entity . getName ( ) . equalsIgnoreCase ( entityName ) ) { return entity ; } } return null ;


signature:
public class MultiValueEntity { /** * Get a single entity value with the supplied name . If there are several headers match the < code > headerName < / code > then
 * the last one is returned .
 * @ param entityName The name of the header to find
 * @ return The found entity value or < code > null < / code > if no header was found . */
public String getValue ( String entityName ) { } }

implementation: notNull ( entityName , "Entity name" ) ; final T entity = get ( entityName ) ; if ( entity == null ) { return null ; } return entity . getValue ( ) ;


signature:
public class MultiValueEntity { /** * Get all entities with the supplied name . If there ' s only one entity matching the < code > entityName < / code > then
 * a list with only that entity is returned .
 * @ param entityName The name of the entity to find
 * @ return The found entities or empty list if no entity was found . */
public List < T > getList ( String entityName ) { } }

implementation: notNull ( entityName , "Entity name" ) ; final List < T > entityList = new ArrayList < T > ( ) ; for ( T entity : entities ) { if ( entity . getName ( ) . equalsIgnoreCase ( entityName ) ) { entityList . add ( entity ) ; } } return Collections . unmodifiableList ( entityList ) ;


signature:
public class MultiValueEntity { /** * Get all entity values of the entity with supplied name . If there ' s only one header matching the < code > entity name < / code > then
 * a list with only that header value is returned .
 * @ param entityName The name of the entity to find
 * @ return The found entity values or empty list if no entity was found . */
public List < String > getValues ( String entityName ) { } }

implementation: final List < T > list = getList ( entityName ) ; final List < String > stringList = new LinkedList < String > ( ) ; for ( T entity : list ) { stringList . add ( entity . getValue ( ) ) ; } return Collections . unmodifiableList ( stringList ) ;


signature:
public class ProxySpecification { /** * Specify the hostname for of the proxy . Will use port { @ value # DEFAULT _ PORT } and scheme { @ value # DEFAULT _ SCHEME } .
 * @ param host The hostname
 * @ return A new ProxySpecification instance */
public static ProxySpecification host ( String host ) { } }

implementation: return new ProxySpecification ( host , DEFAULT_PORT , DEFAULT_SCHEME , DEFAULT_USERNAME , DEFAULT_PASSWORD ) ;


signature:
public class ProxySpecification { /** * Specify preemptive basic authentication for the proxy . Will use hostname { @ value # DEFAULT _ HOST } , port { @ value # DEFAULT _ PORT } and scheme { @ value # DEFAULT _ SCHEME } .
 * @ param username The username
 * @ param password The username
 * @ return A new ProxySpecification instance */
public static ProxySpecification auth ( String username , String password ) { } }

implementation: AssertParameter . notNull ( username , "username" ) ; AssertParameter . notNull ( password , "password" ) ; return new ProxySpecification ( DEFAULT_HOST , DEFAULT_PORT , DEFAULT_SCHEME , username , password ) ;


signature:
public class ProxySpecification { /** * Specify the hostname of the proxy .
 * @ param host The hostname of the proxy .
 * @ return A new ProxySpecification instance */
public ProxySpecification withHost ( String host ) { } }

implementation: return new ProxySpecification ( host , port , scheme , username , password ) ;


signature:
public class ProxySpecification { /** * Specify ( preemptive ) basic authentication for the proxy
 * @ param username The username
 * @ param password The username
 * @ return A new ProxySpecification instance */
public ProxySpecification withAuth ( String username , String password ) { } }

implementation: AssertParameter . notNull ( username , "username" ) ; AssertParameter . notNull ( password , "password" ) ; return new ProxySpecification ( host , port , scheme , username , password ) ;


signature:
public class JsonPathConfig { /** * Specifies if JsonPath should use floats and doubles or BigDecimals to represent Json numbers .
 * @ param numberReturnType The choice .
 * @ return A new instance of JsonPathConfig with the given configuration */
public JsonPathConfig numberReturnType ( NumberReturnType numberReturnType ) { } }

implementation: return new JsonPathConfig ( numberReturnType , defaultParserType , gsonObjectMapperFactory , jackson1ObjectMapperFactory , jackson2ObjectMapperFactory , johnzonObjectMapperFactory , defaultDeserializer , charset ) ;


signature:
public class JsonPathConfig { /** * Creates an json path configuration that uses the specified parser type as default .
 * @ param defaultParserType The parser type to use . If < code > null < / code > then classpath scanning will be used . */
public JsonPathConfig defaultParserType ( JsonParserType defaultParserType ) { } }


signature:
public class JsonPathConfig { /** * Creates an json path configuration that uses the specified object de - serializer as default .
 * @ param defaultObjectDeserializer The object de - serializer to use . If < code > null < / code > then classpath scanning will be used . */
public JsonPathConfig defaultObjectDeserializer ( JsonPathObjectDeserializer defaultObjectDeserializer ) { } }

implementation: return new JsonPathConfig ( numberReturnType , null , gsonObjectMapperFactory , jackson1ObjectMapperFactory , jackson2ObjectMapperFactory , johnzonObjectMapperFactory , defaultObjectDeserializer , charset ) ;


signature:
public class JsonPathConfig { /** * Specify a custom Gson object mapper factory .
 * @ param gsonObjectMapperFactory The object mapper factory */
public JsonPathConfig gsonObjectMapperFactory ( GsonObjectMapperFactory gsonObjectMapperFactory ) { } }


signature:
public class JsonPathConfig { /** * Specify a custom Jackson 1.0 object mapper factory .
 * @ param jackson1ObjectMapperFactory The object mapper factory */
public JsonPathConfig jackson1ObjectMapperFactory ( Jackson1ObjectMapperFactory jackson1ObjectMapperFactory ) { } }


signature:
public class JsonPathConfig { /** * Specify a custom Jackson 1.0 object mapper factory .
 * @ param jackson2ObjectMapperFactory The object mapper factory */
public JsonPathConfig jackson2ObjectMapperFactory ( Jackson2ObjectMapperFactory jackson2ObjectMapperFactory ) { } }


signature:
public class UriValidator { /** * Checks if the < code > potentialUri < / code > is a URI .
 * @ param potentialUri The URI to check .
 * @ return < code > true < / code > if it is a URI , < code > false < / code > otherwise . */
public static boolean isUri ( String potentialUri ) { } }

implementation: if ( StringUtils . isBlank ( potentialUri ) ) { return false ; } try { URI uri = new URI ( potentialUri ) ; return uri . getScheme ( ) != null && uri . getHost ( ) != null ; } catch ( URISyntaxException e ) { return false ; }


signature:
public class LogConfig { /** * Specify a new default stream to the print to .
 * @ param printStream The stream
 * @ return A new LogConfig instance */
public LogConfig defaultStream ( PrintStream printStream ) { } }

implementation: return new LogConfig ( printStream , true , logDetailIfValidationFails , urlEncodeRequestUri , true ) ;


signature:
public class LogConfig { /** * Enable logging of both the request and the response if REST Assureds test validation fails with the specified log detail
 * @ param logDetail The log detail to show in the log
 * @ return A new LogConfig instance */
public LogConfig enableLoggingOfRequestAndResponseIfValidationFails ( LogDetail logDetail ) { } }

implementation: return new LogConfig ( defaultPrintStream , prettyPrintingEnabled , logDetail , urlEncodeRequestUri , true ) ;


signature:
public class HeaderHelper { /** * TODO Extract content - type from headers and apply charset if needed ! */
public static String findContentType ( Headers headers , List < Object > multiParts , SpecificationConfig config ) { } }

implementation:
String requestContentType = headers . getValue ( CONTENT_TYPE ) ; if ( StringUtils . isBlank ( requestContentType ) && ! multiParts . isEmpty ( ) ) { requestContentType = "multipart/" + config . getMultiPartConfig ( ) . defaultSubtype ( ) ; } EncoderConfig encoderConfig = config . getEncoderConfig ( ) ; if ( requestContentType != null && encoderConfig . shouldAppendDefaultContentCharsetToContentTypeIfUndefined ( ) && ! StringUtils . containsIgnoreCase ( requestContentType , CHARSET ) ) { // Append default charset to request content type
requestContentType += "; charset=" ; if ( encoderConfig . hasDefaultCharsetForContentType ( requestContentType ) ) { requestContentType += encoderConfig . defaultCharsetForContentType ( requestContentType ) ; } else { requestContentType += encoderConfig . defaultContentCharset ( ) ; } } return requestContentType ;


signature:
public class HttpRequestFactory { /** * Get the HttpRequest class that represents this request type .
 * @ return a non - abstract class that implements { @ link HttpRequest } */
static HttpRequestBase createHttpRequest ( URI uri , String httpMethod , boolean hasBody ) { } }

implementation:
String method = notNull ( upperCase ( trimToNull ( httpMethod ) ) , "Http method" ) ; Class < ? extends HttpRequestBase > type = HTTP_METHOD_TO_HTTP_REQUEST_TYPE . get ( method ) ; final HttpRequestBase httpRequest ; // If we are sending HTTP method that does not allow body ( like GET ) then HTTP library prevents
// us from including it , however we chose to allow deviations from standard if user wants so ,
// so it needs custom handling - hence the second condition below .
// Otherwise we should use standard implementation found in the map
if ( type == null || ( ! ( type . isInstance ( HttpEntityEnclosingRequest . class ) ) && hasBody ) ) { httpRequest = new CustomHttpMethod ( method , uri ) ; } else { try { httpRequest = type . newInstance ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } httpRequest . setURI ( uri ) ; } return httpRequest ;


signature:
public class StandaloneMockMvcFactory { /** * Create a new { @ link MockMvcFactory } with the supplied controllers or mock mvc configureres
 * @ param controllerOrMockMvcConfigurers Array of controllers or configurerrs
 * @ return A new { @ link MockMvcFactory } */
public static MockMvcFactory of ( Object [ ] controllerOrMockMvcConfigurers ) { } }

implementation: List < Object > controllers = new ArrayList < Object > ( ) ; List < MockMvcConfigurer > configurers = new ArrayList < MockMvcConfigurer > ( ) ; for ( Object object : controllerOrMockMvcConfigurers ) { if ( object instanceof MockMvcConfigurer ) { configurers . add ( ( MockMvcConfigurer ) object ) ; } else { controllers . add ( object ) ; } } StandaloneMockMvcBuilder mockMvc = MockMvcBuilders . standaloneSetup ( controllers . toArray ( ) ) ; if ( ! configurers . isEmpty ( ) ) { for ( MockMvcConfigurer configurer : configurers ) { mockMvc . apply ( configurer ) ; } } return new MockMvcFactory ( mockMvc ) ;


signature:
public class HeaderConfig { /** * Define headers that should be overwritten instead of merged adding headers or using request specifications . Note that
 * by default all headers are merged except the { @ value # ACCEPT _ HEADER _ NAME } and { @ value # CONTENT _ TYPE _ HEADER _ NAME } headers .
 * For example , if the header with name < code > header1 < / code > is < i > not < / i > marked as overwritable ( default ) and you do the following :
 * < pre >
 * given ( ) . header ( " header1 " , " value1 " ) . header ( " header1 , " value2 " ) . . .
 * < / pre >
 * Then < code > header1 < / code > will be sent twice in the request :
 * < pre >
 * header1 : value1
 * header1 : value2
 * < / pre >
 * If you configure < code > header1 < / code > to be overwritable by doing :
 * < pre >
 * given ( ) .
 * config ( RestAssured . config ( ) . headerConfig ( headerConfig ( ) . overwriteHeadersWithName ( " header1 " ) ) .
 * header ( " header1 " , " value1 " ) .
 * header ( " header1 " , " value2 " ) .
 * < / pre >
 * then < code > header1 < / code > will only be sent once :
 * < pre >
 * header1 : value2
 * < / pre >
 * @ param headerName The header name to overwrite .
 * @ param additionalHeaderNames Additional header names to overwrite ( optional ) .
 * @ return A new instance of { @ link HeaderConfig } . */
public HeaderConfig overwriteHeadersWithName ( String headerName , String ... additionalHeaderNames ) { } }

implementation: notNull ( headerName , "Header name" ) ; Map < String , Boolean > map = newHashMapReturningFalseByDefault ( headerName ) ; if ( additionalHeaderNames != null && additionalHeaderNames . length > 0 ) { for ( String additionalHeaderName : additionalHeaderNames ) { map . put ( additionalHeaderName . toUpperCase ( ) , true ) ; } } return new HeaderConfig ( map , true ) ;


signature:
public class MultiPartConfig { /** * Specify the default control name to use if not defined explicitly in multi - part request .
 * Default is { @ value # DEFAULT _ CONTROL _ NAME }
 * @ param defaultControlName The control name to use
 * @ return A new instance of { @ link MultiPartConfig } */
public MultiPartConfig defaultControlName ( String defaultControlName ) { } }

implementation: return new MultiPartConfig ( defaultControlName , defaultFileName , defaultSubtype , defaultBoundary , defaultCharset , true ) ;


signature:
public class MultiPartConfig { /** * Specify the default filename to use if not defined explicitly in multi - part request .
 * Default is { @ value # DEFAULT _ FILE _ NAME }
 * @ param defaultFileName The file name to use
 * @ return A new instance of { @ link MultiPartConfig } */
public MultiPartConfig defaultFileName ( String defaultFileName ) { } }


signature:
public class MultiPartConfig { /** * Specify the default subtype to use if not defined explicitly in when making the multi - part request .
 * This will control how the Content - Type will be constructed for multipart requests when using REST Assured
 * when no Content - Type header has been explicitly defined . For example if subtype is set to " mixed " then the
 * Content - Type header will be " multipart / mixed " if not specified explicitly .
 * Default is { @ value # DEFAULT _ SUBTYPE }
 * @ param defaultSubtype The default subtype to use in multipart requests . Default is { @ value # DEFAULT _ SUBTYPE } .
 * @ return A new instance of { @ link MultiPartConfig } */
public MultiPartConfig defaultSubtype ( String defaultSubtype ) { } }


signature:
public class MultiPartConfig { /** * Specify an explicit default multipart boundary to use when sending multi - part data .
 * @ param defaultBoundary The boundary to set
 * @ return An updated MultiPartConfig */
public MultiPartConfig defaultBoundary ( String defaultBoundary ) { } }


signature:
public class MultiPartConfig { /** * Specify a default charset to use for multi - parts ( default is US - ASCII ) . This affects the encoding of the multipart body ( such as the
 * control name ) but < i > not < / i > the actual < i > content < / i > ( such as the a JSON or String document ) .
 * < b > NOTE : < / b > This setting is < i > only < / i > taken into account if { @ link HttpClientConfig # httpMultipartMode ( HttpMultipartMode ) } is set to
 * something other than { @ link HttpMultipartMode # STRICT } ( which is the default ) . So if you want this setting to apply you also need to
 * explicitly change the multipart mode , for example :
 * < pre >
 * given ( ) .
 * config ( RestAssuredConfig . config ( )
 * . httpClient ( HttpClientConfig . httpClientConfig ( ) . httpMultipartMode ( BROWSER _ COMPATIBLE ) )
 * . multiPartConfig ( multiPartConfig ( ) . defaultCharset ( " UTF - 8 " ) ) ) .
 * when ( ) .
 * post ( " / x " ) . . .
 * < / pre >
 * @ param defaultCharset The default charset to use .
 * @ return An updated MultiPartConfig */
public MultiPartConfig defaultCharset ( String defaultCharset ) { } }


signature:
public class MultiPartConfig { /** * Specify a default charset to use for multi - parts ( default is US - ASCII ) . This affects the encoding of the multipart body ( such as the
 * control name ) but < i > not < / i > the actual < i > content < / i > ( such as the a JSON or String document ) .
 * < b > NOTE : < / b > This setting is < i > only < / i > taken into account if { @ link HttpClientConfig # httpMultipartMode ( HttpMultipartMode ) } is set to
 * something other than { @ link HttpMultipartMode # STRICT } ( which is the default ) . So if you want this setting to apply you also need to
 * explicitly change the multipart mode , for example :
 * < pre >
 * given ( ) .
 * config ( RestAssuredConfig . config ( )
 * . httpClient ( HttpClientConfig . httpClientConfig ( ) . httpMultipartMode ( BROWSER _ COMPATIBLE ) )
 * . multiPartConfig ( multiPartConfig ( ) . defaultCharset ( " UTF - 8 " ) ) ) .
 * when ( ) .
 * post ( " / x " ) . . .
 * < / pre >
 * @ param defaultCharset The default charset to use .
 * @ return An updated MultiPartConfig */
public MultiPartConfig defaultCharset ( Charset defaultCharset ) { } }

implementation: String charsetAsString = AssertParameter . notNull ( defaultCharset , Charset . class ) . toString ( ) ; return new MultiPartConfig ( defaultControlName , defaultFileName , defaultSubtype , defaultBoundary , charsetAsString , true ) ;


signature:
public class MockMvcRequestSpecBuilder { /** * Specify an Object request content that will automatically be serialized to JSON or XML and sent with the request using a specific object mapper .
 * This works for the POST , PATCH and PUT methods only . Trying to do this for the other http methods will cause an exception to be thrown .
 * Note that { @ link # setBody ( Object , ObjectMapper ) }
 * are the same except for the syntactic difference .
 * @ param object The object to serialize and send with the request
 * @ param mapper The object mapper
 * @ return The request specification */
public MockMvcRequestSpecBuilder setBody ( Object object , ObjectMapper mapper ) { } }

implementation: spec . body ( object , mapper ) ; return this ;


signature:
public class MockMvcRequestSpecBuilder { /** * Specify an Object request content that will automatically be serialized to JSON or XML and sent with the request using a specific object mapper type .
 * This works for the POST , PATCH and PUT methods only . Trying to do this for the other http methods will cause an exception to be thrown .
 * Example of use :
 * < pre >
 * Message message = new Message ( ) ;
 * message . setMessage ( " My beautiful message " ) ;
 * given ( ) .
 * body ( message , ObjectMapper . GSON ) .
 * expect ( ) .
 * content ( equalTo ( " Response to a beautiful message " ) ) .
 * when ( ) .
 * post ( " / beautiful - message " ) ;
 * < / pre >
 * Note that { @ link # setBody ( Object , ObjectMapperType ) }
 * are the same except for the syntactic difference .
 * @ param object The object to serialize and send with the request
 * @ param mapperType The object mapper type to be used
 * @ return The request specification */
public MockMvcRequestSpecBuilder setBody ( Object object , ObjectMapperType mapperType ) { } }

implementation: spec . body ( object , mapperType ) ; return this ;


signature:
public class MockMvcRequestSpecBuilder { /** * Set a session attribute .
 * @ param name the session attribute name
 * @ param value the session attribute value */
MockMvcRequestSpecBuilder addSessionAttr ( String name , Object value ) { } }

implementation: spec . sessionAttr ( name , value ) ; return this ;


signature:
public class MockMvcRequestSpecBuilder { /** * Add request attribute
 * @ param attributeName The attribute name
 * @ param attributeValue The attribute value
 * @ return The request specification builder */
public MockMvcRequestSpecBuilder addAttribute ( String attributeName , Object attributeValue ) { } }

implementation: spec . attribute ( attributeName , attributeValue ) ; return this ;


signature:
public class MockMvcRequestSpecBuilder { /** * Add a header to be sent with the request
 * @ param headerName The header name
 * @ param headerValue The header value
 * @ return The request specification builder */
public MockMvcRequestSpecBuilder addHeader ( String headerName , String headerValue ) { } }

implementation: spec . header ( headerName , headerValue ) ; return this ;


signature:
public class MockMvcRequestSpecBuilder { /** * Specify a file to upload to the server using multi - part form data uploading with a specific
 * control name . It will use the content - type < tt > application / octet - stream < / tt > .
 * If this is not what you want please use an overloaded method .
 * @ param file The file to upload
 * @ param controlName Defines the control name of the body part . In HTML this is the attribute name of the input tag .
 * @ return The request specification */
public MockMvcRequestSpecBuilder addMultiPart ( String controlName , File file ) { } }

implementation: spec . multiPart ( controlName , file ) ; return this ;


signature:
public class MockMvcRequestSpecBuilder { /** * Specify a byte - array to upload to the server using multi - part form data .
 * It will use the content - type < tt > application / octet - stream < / tt > . If this is not what you want please use an overloaded method .
 * @ param controlName Defines the control name of the body part . In HTML this is the attribute name of the input tag .
 * @ param fileName The name of the content you ' re uploading
 * @ param bytes The bytes you want to send
 * @ return The request specification */
public MockMvcRequestSpecBuilder addMultiPart ( String controlName , String fileName , byte [ ] bytes ) { } }

implementation: spec . multiPart ( controlName , fileName , bytes ) ; return this ;


signature:
public class MockMvcRequestSpecBuilder { /** * Specify a string to send to the server using multi - part form data .
 * It will use the content - type < tt > text / plain < / tt > . If this is not what you want please use an overloaded method .
 * @ param controlName Defines the control name of the body part . In HTML this is the attribute name of the input tag .
 * @ param contentBody The string to send
 * @ return The request specification */
public MockMvcRequestSpecBuilder addMultiPart ( String controlName , String contentBody ) { } }

implementation: spec . multiPart ( controlName , contentBody ) ; return this ;


signature:
public class MockMvcRequestSpecBuilder { /** * Specify a string to send to the server using multi - part form data with a specific mime - type .
 * @ param controlName Defines the control name of the body part . In HTML this is the attribute name of the input tag .
 * @ param contentBody The string to send
 * @ param mimeType The mime - type
 * @ return The request specification */
public MockMvcRequestSpecBuilder addMultiPart ( String controlName , String contentBody , String mimeType ) { } }

implementation: spec . multiPart ( controlName , mimeType ) ; return this ;


signature:
public class MockMvcRequestSpecBuilder { /** * Set the session id name and value for this request . It ' ll override the default session id name from the configuration ( by default this is { @ value SessionConfig # DEFAULT _ SESSION _ ID _ NAME } ) .
 * You can configure the default session id name by using :
 * < pre >
 * RestAssuredMockMvc . config = newConfig ( ) . sessionConfig ( new SessionConfig ( ) . sessionIdName ( & lt ; sessionIdName & gt ; ) ) ;
 * < / pre >
 * and then you can use the { @ link MockMvcRequestSpecBuilder # setSessionId ( String ) } method to set the session id value without specifying the name for each request .
 * @ param sessionIdName The session id name
 * @ param sessionIdValue The session id value .
 * @ return The request specification */
public MockMvcRequestSpecBuilder setSessionId ( String sessionIdName , String sessionIdValue ) { } }

implementation: spec . sessionId ( sessionIdName , sessionIdValue ) ; return this ;


signature:
public class MockMvcRequestSpecBuilder { /** * Initialize with a { @ link WebApplicationContext } that will be used to create the { @ link MockMvc } instance .
 * Note that this will override the any { @ link MockMvc } instances configured by other setters .
 * @ param context The WebApplicationContext to use
 * @ param mockMvcConfigurers { @ link MockMvcConfigurer } ' s to be applied when creating a { @ link MockMvc } instance of this WebApplicationContext ( optional )
 * @ return MockMvcRequestSpecBuilder
 * @ see MockMvcRequestSpecification # webAppContextSetup ( WebApplicationContext , MockMvcConfigurer . . . ) */
public MockMvcRequestSpecBuilder setWebAppContextSetup ( WebApplicationContext context , MockMvcConfigurer ... mockMvcConfigurers ) { } }

implementation: spec . webAppContextSetup ( context , mockMvcConfigurers ) ; return this ;


signature:
public class MockMvcRequestSpecBuilder { /** * Add a result handler
 * @ param resultHandler The result handler
 * @ return MockMvcRequestSpecBuilder */
public MockMvcRequestSpecBuilder addResultHandlers ( ResultHandler resultHandler , ResultHandler ... additionalResultHandlers ) { } }

implementation: spec . resultHandlers ( resultHandler , additionalResultHandlers ) ; return this ;


signature:
public class MockMvcRequestSpecBuilder { /** * Enabled logging with the specified log detail . Set a { @ link LogConfig } to configure the print stream and pretty printing options .
 * @ param logDetail The log detail .
 * @ return MockMvcRequestSpecBuilder */
public MockMvcRequestSpecBuilder log ( LogDetail logDetail ) { } }

implementation: notNull ( logDetail , LogDetail . class ) ; LogConfig logConfig = spec . getRestAssuredMockMvcConfig ( ) . getLogConfig ( ) ; PrintStream printStream = logConfig . defaultStream ( ) ; boolean prettyPrintingEnabled = logConfig . isPrettyPrintingEnabled ( ) ; boolean shouldUrlEncodeRequestUri = logConfig . shouldUrlEncodeRequestUri ( ) ; spec . setRequestLoggingFilter ( new RequestLoggingFilter ( logDetail , prettyPrintingEnabled , printStream , shouldUrlEncodeRequestUri ) ) ; return this ;


signature:
public class HttpClientConfig { /** * Set a http client parameter .
 * @ param parameterName The name of the parameter
 * @ param parameterValue The value of the parameter ( may be null )
 * @ param < T > The parameter type
 * @ return An updated HttpClientConfig */
public < T > HttpClientConfig setParam ( String parameterName , T parameterValue ) { } }

implementation: notNull ( parameterName , "Parameter name" ) ; final Map < String , Object > newParams = new HashMap < String , Object > ( httpClientParams ) ; newParams . put ( parameterName , parameterValue ) ; return new HttpClientConfig ( httpClientFactory , newParams , httpMultipartMode , shouldReuseHttpClientInstance , NO_HTTP_CLIENT , true ) ;


signature:
public class HttpClientConfig { /** * Replaces the currently configured parameters with the ones supplied by < code > httpClientParams < / code > . This method is the same as { @ link # setParams ( java . util . Map ) } .
 * @ param httpClientParams The parameters to set .
 * @ return An updated HttpClientConfig */
public HttpClientConfig withParams ( Map < String , ? > httpClientParams ) { } }

implementation: return new HttpClientConfig ( httpClientFactory , httpClientParams , httpMultipartMode , shouldReuseHttpClientInstance , NO_HTTP_CLIENT , true ) ;


signature:
public class HttpClientConfig { /** * Add the given parameters to an already configured number of parameters .
 * @ param httpClientParams The parameters .
 * @ return An updated HttpClientConfig */
public HttpClientConfig addParams ( Map < String , ? > httpClientParams ) { } }

implementation: notNull ( httpClientParams , "httpClientParams" ) ; final Map < String , Object > newParams = new HashMap < String , Object > ( this . httpClientParams ) ; newParams . putAll ( httpClientParams ) ; return new HttpClientConfig ( httpClientFactory , newParams , httpMultipartMode , shouldReuseHttpClientInstance , NO_HTTP_CLIENT , true ) ;


signature:
public class HttpClientConfig { /** * Set the http client factory that Rest Assured should use when making request . For each request REST Assured will invoke the factory to get the a the HttpClient instance .
 * @ param httpClientFactory The http client factory to use .
 * @ return An updated HttpClientConfig */
public HttpClientConfig httpClientFactory ( HttpClientFactory httpClientFactory ) { } }


signature:
public class HttpClientConfig { /** * Specify the HTTP Multipart mode when sending multi - part data .
 * @ param httpMultipartMode The multi - part mode to set .
 * @ return An updated HttpClientConfig */
public HttpClientConfig httpMultipartMode ( HttpMultipartMode httpMultipartMode ) { } }

implementation: return new HttpClientConfig ( httpClientFactory , httpClientParams , httpMultipartMode , shouldReuseHttpClientInstance , httpClient , true ) ;


signature:
public class JsonPath { /** * Get the result of an Object path expression as a boolean .
 * @ param path The Object path .
 * @ return The object matching the Object path . This may be any primitive type , a List or a Map . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public < T > T get ( String path ) { } }

implementation: final JSONAssertion jsonAssertion = createJsonAssertion ( path , params ) ; final Object json = jsonParser . parseWith ( createConfigurableJsonSlurper ( ) ) ; return ( T ) jsonAssertion . getResult ( json , null ) ;


signature:
public class JsonPath { /** * Get the result of an Object path expression as an int .
 * @ param path The Object path .
 * @ return The int matching the Object path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public int getInt ( String path ) { } }

implementation:
// The type returned from Groovy depends on the input , so we need to handle different numerical types .
Object value = get ( path ) ; if ( value instanceof Integer ) { return ( Integer ) value ; } else if ( value instanceof Short ) { return ( ( Short ) value ) . intValue ( ) ; } else if ( value instanceof Long ) { return ( ( Long ) value ) . intValue ( ) ; } else { return ObjectConverter . convertObjectTo ( value , Integer . class ) ; }


signature:
public class JsonPath { /** * Get the result of an Object path expression as a byte .
 * @ param path The Object path .
 * @ return The object matching the Object path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public byte getByte ( String path ) { } }

implementation:
// The type returned from Groovy depends on the input , so we need to handle different numerical types .
Object value = get ( path ) ; if ( value instanceof Byte ) { return ( Byte ) value ; } else if ( value instanceof Long ) { return ( ( Long ) value ) . byteValue ( ) ; } else if ( value instanceof Integer ) { return ( ( Integer ) value ) . byteValue ( ) ; } else { return ObjectConverter . convertObjectTo ( value , Byte . class ) ; }


signature:
public class JsonPath { /** * Get the result of an Object path expression as a short .
 * @ param path The Object path .
 * @ return The object matching the Object path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public short getShort ( String path ) { } }

implementation:
// The type returned from Groovy depends on the input , so we need to handle different numerical types .
Object value = get ( path ) ; if ( value instanceof Short ) { return ( Short ) value ; } else if ( value instanceof Long ) { return ( ( Long ) value ) . shortValue ( ) ; } else if ( value instanceof Integer ) { return ( ( Integer ) value ) . shortValue ( ) ; } else { return ObjectConverter . convertObjectTo ( value , Short . class ) ; }


signature:
public class JsonPath { /** * Get the result of an Object path expression as a float .
 * @ param path The Object path .
 * @ return The object matching the Object path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public float getFloat ( String path ) { } }

implementation:
final Object value = get ( path ) ; // Groovy will always return a Double for floating point values .
if ( value instanceof Double ) { return ( ( Double ) value ) . floatValue ( ) ; } else { return ObjectConverter . convertObjectTo ( value , Float . class ) ; }


signature:
public class JsonPath { /** * Get the result of an Object path expression as a double .
 * @ param path The Object path .
 * @ return The object matching the Object path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public double getDouble ( String path ) { } }

implementation: final Object value = get ( path ) ; if ( value instanceof Double ) { return ( Double ) value ; } return ObjectConverter . convertObjectTo ( value , Double . class ) ;


signature:
public class JsonPath { /** * Get the result of an Object path expression as a long .
 * @ param path The Object path .
 * @ return The object matching the Object path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public long getLong ( String path ) { } }

implementation:
// The type returned from Groovy depends on the input , so we need to handle different numerical types .
Object value = get ( path ) ; if ( value instanceof Long ) { return ( Long ) value ; } else if ( value instanceof Short ) { return ( ( Short ) value ) . longValue ( ) ; } else if ( value instanceof Integer ) { return ( ( Integer ) value ) . longValue ( ) ; } else { return ObjectConverter . convertObjectTo ( value , Long . class ) ; }


signature:
public class JsonPath { /** * Get the result of an Object path expression as a list .
 * @ param path The Object path .
 * @ param genericType The generic list type
 * @ param < T > The type
 * @ return The object matching the Object path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public < T > List < T > getList ( String path , Class < T > genericType ) { } }

implementation:
if ( genericType == null ) { throw new IllegalArgumentException ( "Generic type cannot be null" ) ; } final List < T > original = get ( path ) ; final List < T > newList = new LinkedList < T > ( ) ; if ( original != null ) { for ( T t : original ) { T e ; if ( t instanceof Map && ! genericType . isAssignableFrom ( Map . class ) ) { // TODO Avoid double parsing
String str = objectToString ( t ) ; // noinspection unchecked
e = ( T ) jsonStringToObject ( str , genericType ) ; } else { e = ObjectConverter . convertObjectTo ( t , genericType ) ; } newList . add ( e ) ; } } return Collections . unmodifiableList ( newList ) ;


signature:
public class JsonPath { /** * Get the result of an Object path expression as a map .
 * @ param path The Object path .
 * @ param < K > The type of the expected key
 * @ param < V > The type of the expected value
 * @ return The map matching the Object path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public < K , V > Map < K , V > getMap ( String path ) { } }

implementation: return get ( path ) ;


signature:
public class JsonPath { /** * Get the result of a Object path expression as a java Object .
 * E . g . given the following Object document :
 * < pre >
 * { " store " : {
 * " book " : [
 * { " category " : " reference " ,
 * " author " : " Nigel Rees " ,
 * " title " : " Sayings of the Century " ,
 * " price " : 8.95
 * { " category " : " fiction " ,
 * " author " : " Evelyn Waugh " ,
 * " title " : " Sword of Honour " ,
 * " price " : 12.99
 * { " category " : " fiction " ,
 * " author " : " Herman Melville " ,
 * " title " : " Moby Dick " ,
 * " isbn " : " 0-553-21311-3 " ,
 * " price " : 8.99
 * { " category " : " fiction " ,
 * " author " : " J . R . R . Tolkien " ,
 * " title " : " The Lord of the Rings " ,
 * " isbn " : " 0-395-19395-8 " ,
 * " price " : 22.99
 * " bicycle " : {
 * " color " : " red " ,
 * " price " : 19.95
 * < / pre >
 * And a Java object like this :
 * < pre >
 * public class Book {
 * private String category ;
 * private String author ;
 * private String title ;
 * private String isbn ;
 * private float price ;
 * public String getCategory ( ) {
 * return category ;
 * public void setCategory ( String category ) {
 * this . category = category ;
 * public String getAuthor ( ) {
 * return author ;
 * public void setAuthor ( String author ) {
 * this . author = author ;
 * public String getTitle ( ) {
 * return title ;
 * public void setTitle ( String title ) {
 * this . title = title ;
 * public String getIsbn ( ) {
 * return isbn ;
 * public void setIsbn ( String isbn ) {
 * this . isbn = isbn ;
 * public float getPrice ( ) {
 * return price ;
 * public void setPrice ( float price ) {
 * this . price = price ;
 * < / pre >
 * Then
 * < pre >
 * Book book = from ( Object ) . getObject ( " store . book [ 2 ] " , Book . class ) ;
 * < / pre >
 * maps the second book to a Book instance .
 * @ param path The path to the object to map
 * @ param objectType The class type of the expected object
 * @ param < T > The type of the expected object
 * @ return The object */
public < T > T getObject ( String path , Class < T > objectType ) { } }

implementation:
Object object = getJsonObject ( path ) ; if ( object == null ) { return null ; } else if ( object instanceof List || object instanceof Map ) { // TODO Avoid double parsing
object = objectToString ( object ) ; } else { return ObjectConverter . convertObjectTo ( object , objectType ) ; } if ( ! ( object instanceof String ) ) { throw new IllegalStateException ( "Internal error: Json object was not an instance of String, please report to the REST Assured mailing-list." ) ; } return ( T ) jsonStringToObject ( ( String ) object , objectType ) ;


signature:
public class JsonPath { /** * Get the result of a Object path expression as a java Object with generic type .
 * E . g . given the following Object document :
 * < pre >
 * { " store " : {
 * " book " : [
 * { " category " : " reference " ,
 * " author " : " Nigel Rees " ,
 * " title " : " Sayings of the Century " ,
 * " price " : 8.95
 * { " category " : " fiction " ,
 * " author " : " Evelyn Waugh " ,
 * " title " : " Sword of Honour " ,
 * " price " : 12.99
 * { " category " : " fiction " ,
 * " author " : " Herman Melville " ,
 * " title " : " Moby Dick " ,
 * " isbn " : " 0-553-21311-3 " ,
 * " price " : 8.99
 * { " category " : " fiction " ,
 * " author " : " J . R . R . Tolkien " ,
 * " title " : " The Lord of the Rings " ,
 * " isbn " : " 0-395-19395-8 " ,
 * " price " : 22.99
 * " bicycle " : {
 * " color " : " red " ,
 * " price " : 19.95
 * < / pre >
 * And you want to get a book as a < code > Map & lt ; String , Object & gt ; < / code > :
 * Then
 * < pre >
 * Map & lt ; String , Object & gt ; book = from ( Object ) . getObject ( " store . book [ 2 ] " , new TypeRef & lt ; Map & lt ; String , Object & gt ; & gt ; ( ) { } ) ;
 * < / pre >
 * maps the second book to a Book instance .
 * @ param path The path to the object to map
 * @ param typeRef The class type of the expected object
 * @ param < T > The type of the expected object
 * @ return The object */
public < T > T getObject ( String path , TypeRef < T > typeRef ) { } }

implementation: AssertParameter . notNull ( "objectType" , "Type ref" ) ; return getObject ( path , typeRef . getTypeAsClass ( ) ) ;


signature:
public class JsonPath { /** * Add a parameter for the expression . Example :
 * < pre >
 * String name = System . console ( ) . readLine ( ) ;
 * List & lt ; Map & gt ; books = with ( Object ) . param ( " name " , name ) . get ( " store . book . findAll { book - > book . author = = name } " ) ;
 * < / pre >
 * @ param key The name of the parameter . Just use this name in your expression as a variable
 * @ param value The value of the parameter
 * @ return New JsonPath instance with the parameter set */
public JsonPath param ( String key , Object value ) { } }

implementation: JsonPath newP = new JsonPath ( this , config ) ; if ( newP . params == null ) { newP . params = new HashMap < String , Object > ( ) ; } newP . params . put ( key , value ) ; return newP ;


signature:
public class JsonPath { /** * Get and print the JSON as a prettified string .
 * Note that the content is not guaranteed to be looking exactly like the it does at the source . This is because once you peek
 * the content has been downloaded and transformed into another data structure ( used by JsonPath ) and the JSON is rendered
 * from this data structure .
 * @ return The JSON as a prettified String . */
public String prettyPrint ( ) { } }

implementation: final String pretty = prettify ( ) ; System . out . println ( pretty ) ; return pretty ;


signature:
public class XmlConfig { /** * Specify features that will be used when parsing XML .
 * @ param features A map containing features that will be used by the underlying { @ link groovy . util . XmlSlurper } .
 * @ return
 * @ see org . xml . sax . XMLReader # setFeature ( java . lang . String , boolean ) */
public XmlConfig features ( Map < String , Boolean > features ) { } }

implementation: return new XmlConfig ( features , declaredNamespaces , properties , validating , namespaceAware , allowDocTypeDeclaration , true ) ;


signature:
public class XmlConfig { /** * Specify properties that will be used when parsing XML .
 * @ param properties A map containing properties that will be used by the underlying { @ link groovy . util . XmlSlurper } .
 * @ return
 * @ see org . xml . sax . XMLReader # setProperty ( String , Object ) */
public XmlConfig properties ( Map < String , Object > properties ) { } }

implementation: return new XmlConfig ( features , declaredNamespaces , this . properties , validating , namespaceAware , allowDocTypeDeclaration , true ) ;


signature:
public class XmlConfig { /** * Set a value of a feature flag .
 * @ param uri The feature name , which is a fully - qualified URI .
 * @ param enabled The requested value of the feature ( true or false ) .
 * @ return A new XmlConfig instance
 * @ see org . xml . sax . XMLReader # setFeature ( java . lang . String , boolean ) */
public XmlConfig feature ( String uri , boolean enabled ) { } }

implementation: Validate . notEmpty ( uri , "URI cannot be empty" ) ; Map < String , Boolean > newFeatures = new HashMap < String , Boolean > ( features ) ; newFeatures . put ( uri , enabled ) ; return new XmlConfig ( newFeatures , declaredNamespaces , properties , validating , namespaceAware , allowDocTypeDeclaration , true ) ;


signature:
public class XmlConfig { /** * Set a value of a property .
 * @ param name The property name .
 * @ param value The requested value of the feature ( true or false ) .
 * @ return A new XmlConfig instance
 * @ see org . xml . sax . XMLReader # setFeature ( java . lang . String , boolean ) */
public XmlConfig property ( String name , Object value ) { } }

implementation: Validate . notEmpty ( name , "Name cannot be empty" ) ; Map < String , Object > newProperties = new HashMap < String , Object > ( properties ) ; newProperties . put ( name , value ) ; return new XmlConfig ( features , declaredNamespaces , newProperties , validating , namespaceAware , allowDocTypeDeclaration , true ) ;


signature:
public class XmlConfig { /** * Specify declared namespaces that will be used when parsing XML . Will also set { @ link # namespaceAware ( boolean ) } to < code > true < / code > of namespaces are not empty .
 * < p > Note that you cannot use this to add namespaces for the { @ link org . hamcrest . xml . HasXPath } matcher .
 * This has to be done by providing a { @ link javax . xml . namespace . NamespaceContext } to the matcher instance . < / p >
 * @ param namespacesToDeclare A map containing features that will be used by the underlying { @ link groovy . util . XmlSlurper } .
 * @ return A new instance of XmlConfig
 * @ see org . xml . sax . XMLReader # setFeature ( java . lang . String , boolean ) */
public XmlConfig declareNamespaces ( Map < String , String > namespacesToDeclare ) { } }

implementation: final boolean shouldBeNamespaceAware = namespacesToDeclare == null ? namespaceAware : ! namespacesToDeclare . isEmpty ( ) ; return new XmlConfig ( features , namespacesToDeclare , properties , validating , shouldBeNamespaceAware , allowDocTypeDeclaration , true ) ;


signature:
public class XmlConfig { /** * Declares a namespace and also sets { @ link # namespaceAware ( boolean ) } to < code > true < / code > .
 * < p > Note that you cannot use this to add namespaces for the { @ link org . hamcrest . xml . HasXPath } matcher .
 * This has to be done by providing a { @ link javax . xml . namespace . NamespaceContext } to the matcher instance . < / p >
 * @ param prefix The feature name , which is a fully - qualified URI .
 * @ param namespaceURI The requested value of the feature ( true or false ) .
 * @ return A new XmlConfig instance
 * @ see org . xml . sax . XMLReader # setFeature ( java . lang . String , boolean ) */
public XmlConfig declareNamespace ( String prefix , String namespaceURI ) { } }

implementation: Validate . notEmpty ( prefix , "Prefix cannot be empty" ) ; Validate . notEmpty ( namespaceURI , "Namespace URI cannot be empty" ) ; Map < String , String > updatedNamespaces = new HashMap < String , String > ( declaredNamespaces ) ; updatedNamespaces . put ( prefix , namespaceURI ) ; return new XmlConfig ( features , updatedNamespaces , properties , validating , true , allowDocTypeDeclaration , true ) ;


signature:
public class XmlConfig { /** * Disables external DTD loading .
 * This is a shortcut for doing : < br >
 * < pre >
 * setFeature ( " http : / / apache . org / xml / features / nonvalidating / load - external - dtd " , false ) ;
 * < / pre >
 * @ return A new XmlConfig instance
 * @ see # feature ( String , boolean ) */
public XmlConfig disableLoadingOfExternalDtd ( ) { } }

implementation: Map < String , Boolean > newFeatures = new HashMap < String , Boolean > ( features ) ; newFeatures . put ( "http://apache.org/xml/features/nonvalidating/load-external-dtd" , false ) ; return new XmlConfig ( newFeatures , declaredNamespaces , properties , validating , namespaceAware , allowDocTypeDeclaration , true ) ;


signature:
public class XmlConfig { /** * Configure if XmlPath should validate documents as they are parsed ( default is { @ value # DEFAULT _ VALIDATING } ) .
 * Note that this is only applicable when { @ link XmlPath . CompatibilityMode } is equal to
 * { @ link XmlPath . CompatibilityMode # XML } .
 * @ param isValidating < code > true < / code > if the parser should validate documents as they are parsed ; < code > false < / code > otherwise .
 * @ return A new XmlPathConfig instance */
public XmlConfig validating ( boolean isValidating ) { } }

implementation: return new XmlConfig ( features , declaredNamespaces , properties , isValidating , namespaceAware , allowDocTypeDeclaration , true ) ;


signature:
public class XmlConfig { /** * Configure whether or not REST Assured should be aware of namespaces when parsing XML ( default is { @ value # DEFAULT _ NAMESPACE _ AWARE } ) .
 * Note that this is only applicable when { @ link XmlPath . CompatibilityMode } is equal to
 * { @ link XmlPath . CompatibilityMode # XML } .
 * @ param shouldBeAwareOfNamespaces < code > true < / code > if xml parsing should take namespaces into account .
 * @ return A new XmlConfig instance */
public XmlConfig namespaceAware ( boolean shouldBeAwareOfNamespaces ) { } }

implementation: return new XmlConfig ( features , declaredNamespaces , properties , validating , shouldBeAwareOfNamespaces , allowDocTypeDeclaration , true ) ;


signature:
public class XmlConfig { /** * Configure if XmlPath should provide support for DOCTYPE declarations ( default is { @ value # DEFAULT _ ALLOW _ DOC _ TYPE _ DECLARATION } ) .
 * Note that this is only applicable when { @ link XmlPath . CompatibilityMode } is equal to
 * { @ link XmlPath . CompatibilityMode # XML } .
 * @ param allowDocTypeDeclaration < code > true < / code > if the parser should provide support for DOCTYPE declarations ; < code > false < / code > otherwise .
 * @ return A new XmlPathConfig instance */
public XmlConfig allowDocTypeDeclaration ( boolean allowDocTypeDeclaration ) { } }


signature:
public class DecoderConfig { /** * Specify the default charset to use for the specific content - type if it ' s not specified in the content - type header explicitly
 * @ param charset The charset to use as default ( unless specified explicitly )
 * @ param contentType The content - type
 * @ return A new instance of { @ link DecoderConfig } */
public DecoderConfig defaultCharsetForContentType ( String charset , String contentType ) { } }

implementation: notNull ( charset , "Charset" ) ; notNull ( contentType , "ContentType" ) ; Map < String , String > map = new HashMap < String , String > ( contentTypeToDefaultCharset ) ; map . put ( trim ( contentType ) . toLowerCase ( ) , trim ( charset ) ) ; return new DecoderConfig ( charset , useNoWrapForInflateDecoding , true , contentDecoders , map ) ;


signature:
public class DecoderConfig { /** * Specify the default charset to use for the specific content - type if it ' s not specified in the content - type header explicitly
 * @ param charset The charset to use as default ( unless specified explicitly )
 * @ param contentType The content - type
 * @ return A new instance of { @ link DecoderConfig } */
public DecoderConfig defaultCharsetForContentType ( Charset charset , String contentType ) { } }

implementation: notNull ( charset , "Charset" ) ; return defaultCharsetForContentType ( charset . toString ( ) , contentType ) ;


signature:
public class DecoderConfig { /** * Specify the default charset to use for the specific content - type if it ' s not specified in the content - type header explicitly
 * @ param charset The charset to use as default ( unless specified explicitly )
 * @ param contentType The content - type
 * @ return A new instance of { @ link DecoderConfig } */
public DecoderConfig defaultCharsetForContentType ( Charset charset , ContentType contentType ) { } }


signature:
public class DecoderConfig { /** * Specify the default charset of the content in the response that ' s assumed if no charset is explicitly specified in the response .
 * @ param charset The expected charset
 * @ return A new instance of the DecoderConfig . */
@ SuppressWarnings ( "UnusedDeclaration" ) public DecoderConfig defaultContentCharset ( String charset ) { } }

implementation: return new DecoderConfig ( charset , useNoWrapForInflateDecoding , true , contentDecoders , contentTypeToDefaultCharset ) ;


signature:
public class DecoderConfig { /** * Specify the default charset of the content in the response that ' s assumed if no charset is explicitly specified in the response .
 * @ param charset The expected charset
 * @ return A new instance of the DecoderConfig . */
@ SuppressWarnings ( "UnusedDeclaration" ) public DecoderConfig defaultContentCharset ( Charset charset ) { } }

implementation: String charsetAsString = notNull ( charset , Charset . class ) . toString ( ) ; return new DecoderConfig ( charsetAsString , useNoWrapForInflateDecoding , true , contentDecoders , contentTypeToDefaultCharset ) ;


signature:
public class DecoderConfig { /** * Specify the content decoders that will be presented to the server when making a request ( using the < code > Accept - Encoding < / code > header ) .
 * If the server supports any of these encodings then REST Assured will automatically perform decoding of the response accordingly .
 * By default { @ link ContentDecoder # GZIP } and { @ link ContentDecoder # DEFLATE } are used .
 * @ param contentDecoder The first content decoder
 * @ param additionalContentDecoders Optional additional content decoders
 * @ return A new instance of the DecoderConfig . */
public DecoderConfig contentDecoders ( ContentDecoder contentDecoder , ContentDecoder ... additionalContentDecoders ) { } }

implementation: return new DecoderConfig ( defaultContentCharset , useNoWrapForInflateDecoding , true , contentTypeToDefaultCharset , merge ( contentDecoder , additionalContentDecoders ) ) ;


signature:
public class XmlPath { /** * Get the result of an XML path expression . For syntax details please refer to
 * < a href = " http : / / www . groovy - lang . org / processing - xml . html # _ manipulating _ xml " > this < / a > url .
 * @ param path The XML path .
 * @ param < T > The type of the return value .
 * @ return The object matching the XML path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public < T > T get ( String path ) { } }

implementation: AssertParameter . notNull ( path , "path" ) ; return getFromPath ( path , true ) ;


signature:
public class XmlPath { /** * Get the result of an XML path expression as a list . For syntax details please refer to
 * < a href = " http : / / www . groovy - lang . org / processing - xml . html # _ manipulating _ xml " > this < / a > url .
 * @ param path The XML path .
 * @ param genericType The generic list type
 * @ param < T > The type
 * @ return The object matching the XML path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public < T > List < T > getList ( String path , Class < T > genericType ) { } }

implementation: return getAsList ( path , genericType ) ;


signature:
public class XmlPath { /** * Get the result of an XML path expression as a map . For syntax details please refer to
 * < a href = " http : / / www . groovy - lang . org / processing - xml . html # _ manipulating _ xml " > this < / a > url .
 * @ param path The XML path .
 * @ param keyType The type of the expected key
 * @ param valueType The type of the expected value
 * @ param < K > The type of the expected key
 * @ param < V > The type of the expected value
 * @ return The object matching the XML path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public < K , V > Map < K , V > getMap ( String path , Class < K > keyType , Class < V > valueType ) { } }

implementation: final Map < K , V > originalMap = get ( path ) ; final Map < K , V > newMap = new HashMap < K , V > ( ) ; for ( Entry < K , V > entry : originalMap . entrySet ( ) ) { final K key = entry . getKey ( ) == null ? null : convertObjectTo ( entry . getKey ( ) , keyType ) ; final V value = entry . getValue ( ) == null ? null : convertObjectTo ( entry . getValue ( ) , valueType ) ; newMap . put ( key , value ) ; } return Collections . unmodifiableMap ( newMap ) ;


signature:
public class XmlPath { /** * Get an XML document as a Java Object .
 * @ param objectType The type of the java object .
 * @ param < T > The type of the java object
 * @ return A Java object representation of the XML document */
public < T > T getObject ( String path , Class < T > objectType ) { } }

implementation: Object object = getFromPath ( path , false ) ; return getObjectAsType ( object , objectType ) ;


signature:
public class XmlPath { /** * Get the result of an XML path expression as an int . For syntax details please refer to
 * < a href = " http : / / www . groovy - lang . org / processing - xml . html # _ manipulating _ xml " > this < / a > url .
 * @ param path The XML path .
 * @ return The object matching the XML path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public int getInt ( String path ) { } }

implementation: final Object object = get ( path ) ; return convertObjectTo ( object , Integer . class ) ;


signature:
public class XmlPath { /** * Get the result of an XML path expression as a boolean . For syntax details please refer to
 * < a href = " http : / / www . groovy - lang . org / processing - xml . html # _ manipulating _ xml " > this < / a > url .
 * @ param path The XML path .
 * @ return The object matching the XML path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public boolean getBoolean ( String path ) { } }

implementation: Object object = get ( path ) ; return convertObjectTo ( object , Boolean . class ) ;


signature:
public class XmlPath { /** * Get the result of an XML path expression as a char . For syntax details please refer to
 * < a href = " http : / / www . groovy - lang . org / processing - xml . html # _ manipulating _ xml " > this < / a > url .
 * @ param path The XML path .
 * @ return The object matching the XML path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public char getChar ( String path ) { } }

implementation: Object object = get ( path ) ; return convertObjectTo ( object , Character . class ) ;


signature:
public class XmlPath { /** * Get the result of an XML path expression as a byte . For syntax details please refer to
 * < a href = " http : / / www . groovy - lang . org / processing - xml . html # _ manipulating _ xml " > this < / a > url .
 * @ param path The XML path .
 * @ return The object matching the XML path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public byte getByte ( String path ) { } }

implementation: Object object = get ( path ) ; return convertObjectTo ( object , Byte . class ) ;


signature:
public class XmlPath { /** * Get the result of an XML path expression as a short . For syntax details please refer to
 * < a href = " http : / / www . groovy - lang . org / processing - xml . html # _ manipulating _ xml " > this < / a > url .
 * @ param path The XML path .
 * @ return The object matching the XML path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public short getShort ( String path ) { } }

implementation: Object object = get ( path ) ; return convertObjectTo ( object , Short . class ) ;


signature:
public class XmlPath { /** * Get the result of an XML path expression as a float . For syntax details please refer to
 * < a href = " http : / / www . groovy - lang . org / processing - xml . html # _ manipulating _ xml " > this < / a > url .
 * @ param path The XML path .
 * @ return The object matching the XML path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public float getFloat ( String path ) { } }

implementation: Object object = get ( path ) ; return convertObjectTo ( object , Float . class ) ;


signature:
public class XmlPath { /** * Get the result of an XML path expression as a double . For syntax details please refer to
 * < a href = " http : / / www . groovy - lang . org / processing - xml . html # _ manipulating _ xml " > this < / a > url .
 * @ param path The XML path .
 * @ return The object matching the XML path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public double getDouble ( String path ) { } }

implementation: Object object = get ( path ) ; return convertObjectTo ( object , Double . class ) ;


signature:
public class XmlPath { /** * Get the result of an XML path expression as a long . For syntax details please refer to
 * < a href = " http : / / www . groovy - lang . org / processing - xml . html # _ manipulating _ xml " > this < / a > url .
 * @ param path The XML path .
 * @ return The object matching the XML path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public long getLong ( String path ) { } }

implementation: Object object = get ( path ) ; return convertObjectTo ( object , Long . class ) ;


signature:
public class XmlPath { /** * Get the result of an XML path expression as a string . For syntax details please refer to
 * < a href = " http : / / www . groovy - lang . org / processing - xml . html # _ manipulating _ xml " > this < / a > url .
 * @ param path The XML path .
 * @ return The object matching the XML path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public String getString ( String path ) { } }

implementation: Object object = get ( path ) ; return convertObjectTo ( object , String . class ) ;


signature:
public class XmlPath { /** * Get the result of an XML path expression as a UUID . For syntax details please refer to
 * < a href = " http : / / www . groovy - lang . org / processing - xml . html # _ manipulating _ xml " > this < / a > url .
 * @ param path The XML path .
 * @ return The object matching the XML path . A { @ link java . lang . ClassCastException } will be thrown if the object
 * cannot be casted to the expected type . */
public UUID getUUID ( String path ) { } }

implementation: Object object = get ( path ) ; return convertObjectTo ( object , UUID . class ) ;