signature:
public class FormAuthConfig { /** * Enable Cross - site request forgery ( csrf ) support when using form authentication by automatically trying to find the name and value of the csrf input field .
 * For example if the login page looks like this :
 * < pre >
 * & lt ; html & gt ;
 * & lt ; head & gt ;
 * & lt ; title & gt ; Login & lt ; / title & gt ;
 * & lt ; / head & gt ;
 * & lt ; body & gt ;
 * & lt ; form action = & quot ; j _ spring _ security _ check _ with _ csrf & quot ; method = & quot ; POST & quot ; & gt ;
 * & lt ; table & gt ;
 * & lt ; tr & gt ;
 * & lt ; td & gt ; User : & amp ; nbsp ; & lt ; / td & gt ;
 * & lt ; td & gt ; & lt ; input type = & quot ; text & quot ; name = & quot ; j _ username & quot ; & gt ; & lt ; / td & gt ;
 * & lt ; / tr & gt ;
 * & lt ; tr & gt ;
 * & lt ; td & gt ; Password : & lt ; / td & gt ;
 * & lt ; td & gt ; & lt ; input type = & quot ; password & quot ; name = & quot ; j _ password & quot ; & gt ; & lt ; / td & gt ;
 * & lt ; / tr & gt ;
 * & lt ; tr & gt ;
 * & lt ; td colspan = & quot ; 2 & quot ; & gt ; & lt ; input name = & quot ; submit & quot ; type = & quot ; submit & quot ; / & gt ; & lt ; / td & gt ;
 * & lt ; / tr & gt ;
 * & lt ; / table & gt ;
 * & lt ; input type = & quot ; hidden & quot ; name = & quot ; _ csrf & quot ; value = & quot ; 8adf2ea1 - b246-40aa - 8e13 - a85fb7914341 & quot ; / & gt ;
 * & lt ; / form & gt ;
 * & lt ; / body & gt ;
 * & lt ; / html & gt ;
 * < / pre >
 * The csrf field name is called < code > _ csrf < / code > and REST Assured will autodetect its name since the field name is the only < code > hidden < / code > field on this page .
 * If auto - detection fails you can consider using { @ link # withCsrfFieldName ( String ) } .
 * < b > Important : < / b > When enabling csrf support then REST Assured < b > must always < / b > make an additional request to the server in order to
 * be able to include in the csrf value which will slow down the tests .
 * @ return A new FormAuthConfig instance .
 * @ see # withCsrfFieldName ( String ) */
public FormAuthConfig withAutoDetectionOfCsrf ( ) { } }

implementation: if ( hasCsrfFieldName ( ) ) { throw new IllegalStateException ( format ( "Cannot use auto-detection of CSRF field name since a CSRF field name was already defined as '%s'" , csrfFieldName ) ) ; } return new FormAuthConfig ( formAction , userInputTagName , passwordInputTagName , logDetail , logConfig , csrfFieldName , true , sendCsrfTokenAsFormParam , additionalInputFieldNames ) ;


signature:
public class FormAuthConfig { /** * Enables logging with the supplied log detail of the request made to authenticate using form authentication using the
 * specified { @ link LogConfig } . Both the request and the response is logged .
 * @ return A new FormAuthConfig instance . */
public FormAuthConfig withLoggingEnabled ( LogDetail logDetail , LogConfig logConfig ) { } }

implementation: notNull ( logDetail , LogDetail . class ) ; notNull ( logConfig , LogConfig . class ) ; return new FormAuthConfig ( formAction , userInputTagName , passwordInputTagName , logDetail , logConfig , csrfFieldName , autoDetectCsrfFieldName , sendCsrfTokenAsFormParam , additionalInputFieldNames ) ;


signature:
public class PreemptiveAuthProvider { /** * Use preemptive http basic authentication . This means that the authentication details are sent in the request
 * header regardless if the server has challenged for authentication or not .
 * @ param userName The user name .
 * @ param password The password .
 * @ return The Request specification */
public AuthenticationScheme basic ( String userName , String password ) { } }

implementation: final PreemptiveBasicAuthScheme preemptiveBasicAuthScheme = new PreemptiveBasicAuthScheme ( ) ; preemptiveBasicAuthScheme . setUserName ( userName ) ; preemptiveBasicAuthScheme . setPassword ( password ) ; return preemptiveBasicAuthScheme ;


signature:
public class RestAssured { /** * Add default filters that will be applied to each request .
 * @ param filters The filter list */
public static void filters ( List < Filter > filters ) { } }

implementation: Validate . notNull ( filters , "Filter list cannot be null" ) ; RestAssured . filters . addAll ( filters ) ;


signature:
public class RestAssured { /** * Add default filters to apply to each request .
 * @ param filter The filter to add
 * @ param additionalFilters An optional array of additional filters to add */
public static void filters ( Filter filter , Filter ... additionalFilters ) { } }

implementation: Validate . notNull ( filter , "Filter cannot be null" ) ; RestAssured . filters . add ( filter ) ; if ( additionalFilters != null ) { Collections . addAll ( RestAssured . filters , additionalFilters ) ; }


signature:
public class RestAssured { /** * Sets the default filters to apply to each request .
 * @ param filters The filter list */
public static void replaceFiltersWith ( List < Filter > filters ) { } }

implementation: Validate . notNull ( filters , "Filter list cannot be null" ) ; RestAssured . filters . clear ( ) ; filters ( filters ) ;


signature:
public class RestAssured { /** * Sets the default filters to apply to each request .
 * @ param filter The filter to set
 * @ param additionalFilters An optional array of additional filters to set */
public static void replaceFiltersWith ( Filter filter , Filter ... additionalFilters ) { } }

implementation: Validate . notNull ( filter , "Filter cannot be null" ) ; RestAssured . filters . clear ( ) ; filters ( filter , additionalFilters ) ;


signature:
public class RestAssured { /** * Set a object mapper that ' ll be used when serializing and deserializing Java objects to and from it ' s
 * document representation ( XML , JSON etc ) .
 * @ param objectMapper The object mapper to use . */
public static void objectMapper ( ObjectMapper objectMapper ) { } }

implementation: Validate . notNull ( objectMapper , "Default object mapper cannot be null" ) ; config = config ( ) . objectMapperConfig ( ObjectMapperConfig . objectMapperConfig ( ) . defaultObjectMapper ( objectMapper ) ) ;


signature:
public class RestAssured { /** * Create a list of arguments that can be used to create parts of the path in a body / content expression .
 * This is useful in situations where you have e . g . pre - defined variables that constitutes the key . For example :
 * < pre >
 * String someSubPath = " else " ;
 * int index = 1;
 * when ( ) . get ( ) . then ( ) . 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 >
 * get ( " / x " ) . then ( ) . assertThat ( ) .
 * root ( " filters . filterConfig [ % d ] . filterConfigGroups . find { it . name = = ' Gold ' } . includes " ) .
 * body ( withArgs ( 0 ) , hasItem ( " first " ) ) .
 * body ( withArgs ( 1 ) , hasItem ( " second " ) ) .
 * < / pre >
 * The key 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 .
 * @ return A list of arguments . */
public static List < Argument > withArgs ( Object firstArgument , Object ... additionalArguments ) { } }

implementation: Validate . notNull ( firstArgument , "You need to supply at least one argument" ) ; final List < Argument > arguments = new LinkedList < Argument > ( ) ; arguments . add ( Argument . arg ( firstArgument ) ) ; if ( additionalArguments != null && additionalArguments . length > 0 ) { for ( Object additionalArgument : additionalArguments ) { arguments . add ( Argument . arg ( additionalArgument ) ) ; } } return Collections . unmodifiableList ( arguments ) ;


signature:
public class RestAssured { /** * Perform a GET 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 > get ( " / book / { hotelName } / { roomNumber } " , " Hotels R Us " , 22 ) ; < / code > .
 * @ return The response of the GET request . */
public static Response get ( String path , Object ... pathParams ) { } }

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


signature:
public class RestAssured { /** * Perform a GET 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 GET request . */
public static Response get ( String path , Map < String , ? > pathParams ) { } }


signature:
public class RestAssured { /** * Perform a POST 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 > post ( " / book / { hotelName } / { roomNumber } " , " Hotels R Us " , 22 ) ; < / code > .
 * @ return The response of the request . */
public static Response post ( String path , Object ... pathParams ) { } }

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


signature:
public class RestAssured { /** * Perform a POST 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 Response post ( String path , Map < String , ? > pathParams ) { } }


signature:
public class RestAssured { /** * Perform a PUT 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 > put ( " / book / { hotelName } / { roomNumber } " , " Hotels R Us " , 22 ) ; < / code > .
 * @ return The response of the request . */
public static Response put ( String path , Object ... pathParams ) { } }

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


signature:
public class RestAssured { /** * Perform a DELETE 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 > delete ( " / book / { hotelName } / { roomNumber } " , " Hotels R Us " , 22 ) ; < / code > .
 * @ return The response of the request . */
public static Response delete ( String path , Object ... pathParams ) { } }

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


signature:
public class RestAssured { /** * Perform a DELETE 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 Response delete ( String path , Map < String , ? > pathParams ) { } }


signature:
public class RestAssured { /** * 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 Response head ( String path , Object ... pathParams ) { } }

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


signature:
public class RestAssured { /** * 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 Response head ( String path , Map < String , ? > pathParams ) { } }


signature:
public class RestAssured { /** * 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 Response patch ( String path , Object ... pathParams ) { } }

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


signature:
public class RestAssured { /** * 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 Response patch ( String path , Map < String , ? > pathParams ) { } }


signature:
public class RestAssured { /** * 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 Response options ( String path , Object ... pathParams ) { } }

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


signature:
public class RestAssured { /** * 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 Response options ( String path , Map < String , ? > pathParams ) { } }


signature:
public class RestAssured { /** * 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 Response request ( Method method , URI uri ) { } }

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


signature:
public class RestAssured { /** * 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 Response request ( Method method , URL url ) { } }

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


signature:
public class RestAssured { /** * 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 Response request ( String method , URI uri ) { } }


signature:
public class RestAssured { /** * 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 Response request ( String method , URL url ) { } }


signature:
public class RestAssured { /** * Create a http basic authentication scheme .
 * @ param userName The user name .
 * @ param password The password .
 * @ return The authentication scheme */
public static AuthenticationScheme basic ( String userName , String password ) { } }

implementation: final BasicAuthScheme scheme = new BasicAuthScheme ( ) ; scheme . setUserName ( userName ) ; scheme . setPassword ( password ) ; return scheme ;


signature:
public class RestAssured { /** * Create a NTLM authentication scheme .
 * @ param userName The user name .
 * @ param password The password .
 * @ param workstation The NTLM workstation .
 * @ param domain The NTLM workstation .
 * @ return The authentication scheme */
public static AuthenticationScheme ntlm ( String userName , String password , String workstation , String domain ) { } }

implementation: final NTLMAuthScheme scheme = new NTLMAuthScheme ( ) ; scheme . setUserName ( userName ) ; scheme . setPassword ( password ) ; scheme . setWorkstation ( workstation ) ; scheme . setDomain ( domain ) ; return scheme ;


signature:
public class RestAssured { /** * Use form authentication . Rest Assured will try to parse the response
 * login page and determine and try find the action , username and password input
 * field automatically .
 * Note that the request will be much faster if you also supply a form auth configuration .
 * @ param userName The user name .
 * @ param password The password .
 * @ return The authentication scheme
 * @ see # form ( String , String , FormAuthConfig ) */
public static AuthenticationScheme form ( String userName , String password ) { } }

implementation: return form ( userName , password , null ) ;


signature:
public class RestAssured { /** * Use form authentication with the supplied configuration .
 * @ param userName The user name .
 * @ param password The password .
 * @ param config The form authentication config
 * @ return The authentication scheme */
public static AuthenticationScheme form ( String userName , String password , FormAuthConfig config ) { } }

implementation: if ( userName == null ) { throw new IllegalArgumentException ( "Username cannot be null" ) ; } if ( password == null ) { throw new IllegalArgumentException ( "Password cannot be null" ) ; } final FormAuthScheme scheme = new FormAuthScheme ( ) ; scheme . setUserName ( userName ) ; scheme . setPassword ( password ) ; scheme . setConfig ( config ) ; return scheme ;


signature:
public class RestAssured { /** * Sets a certificate to be used for SSL authentication . See { @ link java . lang . Class # getResource ( String ) }
 * for how to get a URL from a resource on the classpath .
 * Uses SSL settings defined in { @ link SSLConfig } .
 * @ param certURL URL to a JKS keystore where the certificate is stored .
 * @ param password The password for the keystore
 * @ return The request io . restassured . specification */
public static AuthenticationScheme certificate ( String certURL , String password ) { } }

implementation: SSLConfig sslConfig = config ( ) . getSSLConfig ( ) ; return certificate ( certURL , password , CertificateAuthSettings . certAuthSettings ( ) . keyStoreType ( sslConfig . getKeyStoreType ( ) ) . trustStore ( sslConfig . getTrustStore ( ) ) . keyStore ( sslConfig . getKeyStore ( ) ) . trustStoreType ( sslConfig . getTrustStoreType ( ) ) . x509HostnameVerifier ( sslConfig . getX509HostnameVerifier ( ) ) . port ( sslConfig . getPort ( ) ) . sslSocketFactory ( sslConfig . getSSLSocketFactory ( ) ) ) ;


signature:
public class RestAssured { /** * Sets a certificate to be used for SSL authentication . See { @ link Class # getResource ( String ) } for how to get a URL from a resource
 * on the classpath .
 * @ param certURL URL to a JKS keystore where the certificate is stored .
 * @ param password The password for the keystore
 * @ param certificateAuthSettings More advanced settings for the certificate authentication */
public static AuthenticationScheme certificate ( String certURL , String password , CertificateAuthSettings certificateAuthSettings ) { } }

implementation: return certificate ( certURL , password , "" , "" , certificateAuthSettings ) ;


signature:
public class RestAssured { /** * Sets a certificate to be used for SSL authentication . See { @ link Class # getResource ( String ) } for how to get a URL from a resource
 * on the classpath .
 * @ param trustStorePath URL to a JKS trust store where the certificate is stored .
 * @ param trustStorePassword The password for the trust store
 * @ param keyStorePath URL to a JKS keystore where the certificate is stored .
 * @ param keyStorePassword The password for the keystore
 * @ param certificateAuthSettings More advanced settings for the certificate authentication */
public static AuthenticationScheme certificate ( String trustStorePath , String trustStorePassword , String keyStorePath , String keyStorePassword , CertificateAuthSettings certificateAuthSettings ) { } }

implementation: AssertParameter . notNull ( keyStorePath , "Keystore path" ) ; AssertParameter . notNull ( keyStorePassword , "Keystore password" ) ; AssertParameter . notNull ( trustStorePath , "Trust store path" ) ; AssertParameter . notNull ( trustStorePassword , "Keystore password" ) ; AssertParameter . notNull ( certificateAuthSettings , CertificateAuthSettings . class ) ; final CertAuthScheme scheme = new CertAuthScheme ( ) ; scheme . setPathToKeyStore ( keyStorePath ) ; scheme . setKeyStorePassword ( keyStorePassword ) ; scheme . setKeystoreType ( certificateAuthSettings . getKeyStoreType ( ) ) ; scheme . setKeyStore ( certificateAuthSettings . getKeyStore ( ) ) ; scheme . setPort ( certificateAuthSettings . getPort ( ) ) ; scheme . setTrustStore ( certificateAuthSettings . getTrustStore ( ) ) ; scheme . setTrustStoreType ( certificateAuthSettings . getTrustStoreType ( ) ) ; scheme . setPathToTrustStore ( trustStorePath ) ; scheme . setTrustStorePassword ( trustStorePassword ) ; scheme . setX509HostnameVerifier ( certificateAuthSettings . getX509HostnameVerifier ( ) ) ; scheme . setSslSocketFactory ( certificateAuthSettings . getSSLSocketFactory ( ) ) ; return scheme ;


signature:
public class RestAssured { /** * Excerpt from the HttpBuilder docs : < br >
 * OAuth sign the request . Note that this currently does not wait for a WWW - Authenticate challenge before sending the the OAuth header .
 * All requests to all domains will be signed for this instance .
 * This assumes you ' ve already generated an accessToken and secretToken for the site you ' re targeting .
 * For More information on how to achieve this , see the < a href = " https : / / github . com / mttkay / signpost / blob / master / docs / GettingStarted . md # using - signpost " > Signpost documentation < / a > .
 * @ param consumerKey
 * @ param consumerSecret
 * @ param accessToken
 * @ param secretToken
 * @ param signature
 * @ return The authentication scheme */
public static AuthenticationScheme oauth ( String consumerKey , String consumerSecret , String accessToken , String secretToken , OAuthSignature signature ) { } }

implementation: OAuthScheme scheme = new OAuthScheme ( ) ; scheme . setConsumerKey ( consumerKey ) ; scheme . setConsumerSecret ( consumerSecret ) ; scheme . setAccessToken ( accessToken ) ; scheme . setSecretToken ( secretToken ) ; scheme . setSignature ( signature ) ; return scheme ;


signature:
public class RestAssured { /** * OAuth sign the request . Note that this currently does not wait for a WWW - Authenticate challenge before sending the the OAuth header .
 * All requests to all domains will be signed for this instance .
 * @ param accessToken The access token to use
 * @ return The authentication scheme */
public static AuthenticationScheme oauth2 ( String accessToken ) { } }

implementation: PreemptiveOAuth2HeaderScheme myScheme = new PreemptiveOAuth2HeaderScheme ( ) ; myScheme . setAccessToken ( accessToken ) ; return myScheme ;


signature:
public class RestAssured { /** * OAuth sign the request . Note that this currently does not wait for a WWW - Authenticate challenge before sending the the OAuth header .
 * All requests to all domains will be signed for this instance .
 * @ param accessToken
 * @ param signature
 * @ return The authentication scheme */
public static AuthenticationScheme oauth2 ( String accessToken , OAuthSignature signature ) { } }

implementation: OAuth2Scheme scheme = new OAuth2Scheme ( ) ; scheme . setAccessToken ( accessToken ) ; scheme . setSignature ( signature ) ; return scheme ;


signature:
public class RestAssured { /** * Resets the { @ link # baseURI } , { @ link # basePath } , { @ link # port } , { @ link # authentication } and { @ link # rootPath } ,
 * { @ link # filters ( java . util . List ) } , { @ link # requestSpecification } , { @ link # responseSpecification } ,
 * { @ link # urlEncodingEnabled } , { @ link # config } , { @ link # sessionId } and { @ link # proxy } to their default values of { @ value # DEFAULT _ URI } , { @ value # DEFAULT _ PATH } , { @ value # UNDEFINED _ PORT } ,
 * < code > no authentication < / code > , & lt ; empty string & gt ; , < code > null < / code > , < code > null < / code > ,
 * & lt ; empty list & gt ; , < code > null < / code > , < code > null < / code > , < code > none < / code > , < code > true < / code > , < code > new RestAssuredConfig ( ) < / code > , < code > null < / code > and < code > null < / code > . */
public static void reset ( ) { } }

implementation: baseURI = DEFAULT_URI ; port = UNDEFINED_PORT ; basePath = DEFAULT_PATH ; authentication = DEFAULT_AUTH ; rootPath = DEFAULT_BODY_ROOT_PATH ; filters = new LinkedList < Filter > ( ) ; requestSpecification = null ; responseSpecification = null ; urlEncodingEnabled = DEFAULT_URL_ENCODING_ENABLED ; RESPONSE_PARSER_REGISTRAR = new ResponseParserRegistrar ( ) ; defaultParser = null ; config = new RestAssuredConfig ( ) ; sessionId = DEFAULT_SESSION_ID_VALUE ; proxy = null ;


signature:
public class RestAssured { /** * Use relaxed HTTP validation with a specific protocol . This means that you ' ll trust all hosts regardless if the SSL certificate is invalid . By using this
 * method you don ' t need to specify a keystore ( see { @ link # keyStore ( String , String ) } or trust store ( see { @ link # trustStore ( java . security . KeyStore ) } .
 * This is just a shortcut for :
 * < pre >
 * RestAssured . config = RestAssured . config ( ) . sslConfig ( sslConfig ( ) . relaxedHTTPSValidation ( & lt ; protocol & gt ; ) ) ;
 * < / pre >
 * @ param protocol The standard name of the requested protocol . See the SSLContext section in the < a href = " https : / / docs . oracle . com / javase / 8 / docs / technotes / guides / security / StandardNames . html # SSLContext " > Java Cryptography Architecture Standard Algorithm Name Documentation < / a > for information about standard protocol names . */
public static void useRelaxedHTTPSValidation ( String protocol ) { } }

implementation: config = RestAssured . config ( ) . sslConfig ( SSLConfig . sslConfig ( ) . relaxedHTTPSValidation ( protocol ) ) ;


signature:
public class RestAssured { /** * 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 = RestAssured . config ( ) . logConfig ( logConfig ( ) . enableLoggingOfRequestAndResponseIfValidationFails ( logDetail ) ) ;
 * < / pre >
 * @ param logDetail The log detail to show in the log */
public static void enableLoggingOfRequestAndResponseIfValidationFails ( LogDetail logDetail ) { } }

implementation:
LogConfig logConfig = LogConfig . logConfig ( ) . enableLoggingOfRequestAndResponseIfValidationFails ( logDetail ) ; config = RestAssured . config ( ) . logConfig ( logConfig ) ; // 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 RequestSpecificationImpl ) { RestAssuredConfig restAssuredConfig = ( ( RequestSpecificationImpl ) requestSpecification ) . getConfig ( ) ; if ( restAssuredConfig == null ) { restAssuredConfig = config ; } else { LogConfig logConfigForRequestSpec = restAssuredConfig . getLogConfig ( ) . enableLoggingOfRequestAndResponseIfValidationFails ( logDetail ) ; restAssuredConfig = restAssuredConfig . logConfig ( logConfigForRequestSpec ) ; } requestSpecification . config ( restAssuredConfig ) ; }


signature:
public class RestAssured { /** * Apply a keystore for all requests
 * < pre >
 * given ( ) . keyStore ( " / truststore _ javanet . jks " , " test1234 " ) . . .
 * < / pre >
 * Note that this is just a shortcut for :
 * < pre >
 * RestAssured . config = RestAssured . config ( ) . sslConfig ( sslConfig ( ) . keyStore ( pathToJks , password ) ) ;
 * < / pre >
 * @ param pathToJks The path to the JKS . REST Assured will first look in the classpath and if not found it will look for the JKS in the local file - system
 * @ param password The store pass */
public static void keyStore ( String pathToJks , String password ) { } }

implementation: Validate . notEmpty ( password , "Password cannot be empty" ) ; applyKeyStore ( pathToJks , password ) ;


signature:
public class RestAssured { /** * The following documentation is taken from < a href = " HTTP Builder " > https : / / github . com / jgritman / httpbuilder / wiki / SSL < / a > :
 * < h1 > SSL Configuration < / h1 >
 * SSL should , for the most part , " just work . " There are a few situations where it is not completely intuitive . You can follow the example below , or see HttpClient ' s SSLSocketFactory documentation for more information .
 * < h1 > SSLPeerUnverifiedException < / h1 >
 * If you can ' t connect to an SSL website , it is likely because the certificate chain is not trusted . This is an Apache HttpClient issue , but explained here for convenience . To correct the untrusted certificate , you need to import a certificate into an SSL truststore .
 * First , export a certificate from the website using your browser . For example , if you go to https : / / dev . java . net in Firefox , you will probably get a warning in your browser . Choose " Add Exception , " " Get Certificate , " " View , " " Details tab . " Choose a certificate in the chain and export it as a PEM file . You can view the details of the exported certificate like so :
 * < pre >
 * $ keytool - printcert - file EquifaxSecureGlobaleBusinessCA - 1 . crt
 * Owner : CN = Equifax Secure Global eBusiness CA - 1 , O = Equifax Secure Inc . , C = US
 * Issuer : CN = Equifax Secure Global eBusiness CA - 1 , O = Equifax Secure Inc . , C = US
 * Serial number : 1
 * Valid from : Mon Jun 21 00:00:00 EDT 1999 until : Sun Jun 21 00:00:00 EDT 2020
 * Certificate fingerprints :
 * MD5 : 8F : 5D : 77:06:27 : C4:98:3C : 5B : 93:78 : E7 : D7:7D : 9B : CC
 * SHA1 : 7E : 78:4A : 10:1C : 82:65 : CC : 2D : E1 : F1:6D : 47 : B4:40 : CA : D9:0A : 19:45
 * Signature algorithm name : MD5withRSA
 * Version : 3
 * < / pre >
 * Now , import that into a Java keystore file :
 * < pre >
 * $ keytool - importcert - alias " equifax - ca " - file EquifaxSecureGlobaleBusinessCA - 1 . crt - keystore truststore _ javanet . jks - storepass test1234
 * Owner : CN = Equifax Secure Global eBusiness CA - 1 , O = Equifax Secure Inc . , C = US
 * Issuer : CN = Equifax Secure Global eBusiness CA - 1 , O = Equifax Secure Inc . , C = US
 * Serial number : 1
 * Valid from : Mon Jun 21 00:00:00 EDT 1999 until : Sun Jun 21 00:00:00 EDT 2020
 * Certificate fingerprints :
 * MD5 : 8F : 5D : 77:06:27 : C4:98:3C : 5B : 93:78 : E7 : D7:7D : 9B : CC
 * SHA1 : 7E : 78:4A : 10:1C : 82:65 : CC : 2D : E1 : F1:6D : 47 : B4:40 : CA : D9:0A : 19:45
 * Signature algorithm name : MD5withRSA
 * Version : 3
 * Trust this certificate ? [ no ] : yes
 * Certificate was added to keystore
 * < / pre >
 * Now you want to use this truststore in your client :
 * < pre >
 * RestAssured . trustSture ( " / truststore _ javanet . jks " , " test1234 " ) ;
 * < / pre >
 * or
 * < pre >
 * given ( ) . trustStore ( " / truststore _ javanet . jks " , " test1234 " ) . . .
 * < / pre >
 * Note that this is just a shortcut for :
 * < pre >
 * RestAssured . config = RestAssured . config ( ) . sslConfig ( sslConfig ( ) . trustStore ( pathToJks , password ) ) ;
 * < / pre >
 * @ param pathToJks The path to the JKS . REST Assured will first look in the classpath and if not found it will look for the JKS in the local file - system
 * @ param password The store pass */
public static void trustStore ( String pathToJks , String password ) { } }

implementation: Validate . notEmpty ( password , "Password cannot be empty" ) ; applyTrustStore ( pathToJks , password ) ;


signature:
public class RestAssured { /** * Specify a trust store that ' ll be used for HTTPS requests . A trust store is a { @ link java . security . KeyStore } that has been loaded with the password .
 * If you wish that REST Assured loads the KeyStore store and applies the password ( thus making it a trust store ) please see some of the
 * < code > keystore < / code > methods such as { @ link # keyStore ( java . io . File , String ) } .
 * @ param truststore A pre - loaded { @ link java . security . KeyStore } .
 * @ see # keyStore ( String , String ) */
public static void trustStore ( KeyStore truststore ) { } }

implementation: Validate . notNull ( truststore , "Truststore cannot be null" ) ; config = config ( ) . sslConfig ( SSLConfig . sslConfig ( ) . trustStore ( truststore ) ) ;


signature:
public class RestAssured { /** * Use a keystore located on the file - system . See { @ link # keyStore ( String , String ) } for more details .
 * Note that this is just a shortcut for :
 * < pre >
 * RestAssured . config = RestAssured . config ( ) . sslConfig ( sslConfig ( ) . keyStore ( pathToJks , password ) ) ;
 * < / pre >
 * @ param pathToJks The path to JKS file on the file - system
 * @ param password The password for the keystore
 * @ see # keyStore ( String , String ) */
public static void keyStore ( File pathToJks , String password ) { } }

implementation: Validate . notNull ( pathToJks , "Path to JKS on the file system cannot be null" ) ; applyKeyStore ( pathToJks , password ) ;


signature:
public class RestAssured { /** * Use a trust store located on the file - system . See { @ link # trustStore ( String , String ) } for more details .
 * Note that this is just a shortcut for :
 * < pre >
 * RestAssured . config = RestAssured . config ( ) . sslConfig ( sslConfig ( ) . trustStore ( pathToJks , password ) ) ;
 * < / pre >
 * @ param pathToJks The path to JKS file on the file - system
 * @ param password The password for the keystore
 * @ see # keyStore ( String , String ) */
public static void trustStore ( File pathToJks , String password ) { } }

implementation: Validate . notNull ( pathToJks , "Path to JKS on the file system cannot be null" ) ; applyTrustStore ( pathToJks , password ) ;


signature:
public class RestAssured { /** * Instruct REST Assured to connect to a proxy on the specified host on port < code > 8888 < / code > .
 * @ param host The hostname of the proxy to connect to ( for example < code > 127.0.0.1 < / code > ) . Can also be a URI represented as a String .
 * @ see # proxy ( String , int ) */
public static void proxy ( String host ) { } }

implementation: if ( UriValidator . isUri ( host ) ) { try { proxy ( new URI ( host ) ) ; } catch ( URISyntaxException e ) { throw new RuntimeException ( "Internal error in REST Assured when constructing URI for Proxy." , e ) ; } } else { proxy ( host ( host ) ) ; }


signature:
public class RestAssured { /** * Instruct REST Assured to connect to a proxy on the specified port on localhost with a specific scheme .
 * @ param host The hostname of the proxy to connect to ( for example < code > 127.0.0.1 < / code > )
 * @ param port The port of the proxy to connect to ( for example < code > 8888 < / code > )
 * @ param scheme The http scheme ( http or https ) */
public static void proxy ( String host , int port , String scheme ) { } }

implementation: proxy ( new ProxySpecification ( host , port , scheme ) ) ;


signature:
public class RestAssured { /** * Instruct REST Assured to connect to a proxy using a URI .
 * @ param uri The URI of the proxy */
public static void proxy ( URI uri ) { } }

implementation: if ( uri == null ) { throw new IllegalArgumentException ( "Proxy URI cannot be null" ) ; } proxy ( new ProxySpecification ( uri . getHost ( ) , uri . getPort ( ) , uri . getScheme ( ) ) ) ;


signature:
public class ResponsePrinter { /** * Prints the response to the print stream
 * @ return A string of representing the response */
public static String print ( ResponseOptions responseOptions , ResponseBody responseBody , PrintStream stream , LogDetail logDetail , boolean shouldPrettyPrint ) { } }

implementation: final StringBuilder builder = new StringBuilder ( ) ; if ( logDetail == ALL || logDetail == STATUS ) { builder . append ( responseOptions . statusLine ( ) ) ; } if ( logDetail == ALL || logDetail == HEADERS ) { final Headers headers = responseOptions . headers ( ) ; if ( headers . exist ( ) ) { appendNewLineIfAll ( logDetail , builder ) . append ( toString ( headers ) ) ; } } else if ( logDetail == COOKIES ) { final Cookies cookies = responseOptions . detailedCookies ( ) ; if ( cookies . exist ( ) ) { appendNewLineIfAll ( logDetail , builder ) . append ( cookies . toString ( ) ) ; } } if ( logDetail == ALL || logDetail == BODY ) { String responseBodyToAppend ; if ( shouldPrettyPrint ) { responseBodyToAppend = new Prettifier ( ) . getPrettifiedBodyIfPossible ( responseOptions , responseBody ) ; } else { responseBodyToAppend = responseBody . asString ( ) ; } if ( logDetail == ALL && ! isBlank ( responseBodyToAppend ) ) { builder . append ( SystemUtils . LINE_SEPARATOR ) . append ( SystemUtils . LINE_SEPARATOR ) ; } builder . append ( responseBodyToAppend ) ; } String response = builder . toString ( ) ; stream . println ( response ) ; return response ;


signature:
public class RestAssuredConfig { /** * Set the redirect config .
 * @ param redirectConfig The { @ link RedirectConfig } to set
 * @ return An updated RestAssuredConfiguration */
public RestAssuredConfig redirect ( RedirectConfig redirectConfig ) { } }

implementation: notNull ( redirectConfig , "Redirect config" ) ; return new RestAssuredConfig ( redirectConfig , conf ( HttpClientConfig . class ) , conf ( LogConfig . class ) , conf ( EncoderConfig . class ) , conf ( DecoderConfig . class ) , conf ( SessionConfig . class ) , conf ( ObjectMapperConfig . class ) , conf ( ConnectionConfig . class ) , conf ( JsonConfig . class ) , conf ( XmlConfig . class ) , conf ( SSLConfig . class ) , conf ( MatcherConfig . class ) , conf ( HeaderConfig . class ) , conf ( MultiPartConfig . class ) , conf ( ParamConfig . class ) , conf ( OAuthConfig . class ) , conf ( FailureConfig . class ) ) ;


signature:
public class EncoderConfig { /** * 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 EncoderConfig } */
public EncoderConfig 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 EncoderConfig ( charset , defaultQueryParameterCharset , shouldAppendDefaultContentCharsetToContentTypeIfUndefined , contentEncoders , map , true ) ;


signature:
public class EncoderConfig { /** * 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 EncoderConfig } */
public EncoderConfig defaultCharsetForContentType ( Charset charset , ContentType contentType ) { } }

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


signature:
public class EncoderConfig { /** * 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 EncoderConfig } */
public EncoderConfig defaultCharsetForContentType ( Charset charset , String contentType ) { } }


signature:
public class EncoderConfig { /** * Specify the default charset for the body / content in the request specification
 * @ param charset The charset to use .
 * @ return A new instance of { @ link EncoderConfig } */
public EncoderConfig defaultContentCharset ( Charset charset ) { } }

implementation: String charsetAsString = notNull ( charset , Charset . class ) . toString ( ) ; return new EncoderConfig ( charsetAsString , defaultQueryParameterCharset , shouldAppendDefaultContentCharsetToContentTypeIfUndefined , contentEncoders , contentTypeToDefaultCharset , true ) ;


signature:
public class EncoderConfig { /** * Specify the default charset for query parameters
 * @ param charset The charset to use .
 * @ return A new instance of { @ link EncoderConfig } */
public EncoderConfig defaultQueryParameterCharset ( String charset ) { } }

implementation: return new EncoderConfig ( defaultContentCharset , charset , shouldAppendDefaultContentCharsetToContentTypeIfUndefined , contentEncoders , contentTypeToDefaultCharset , true ) ;


signature:
public class EncoderConfig { /** * Tells whether REST Assured should automatically append the content charset to the content - type header if not defined explicitly .
 * Note that this does not affect multipart form data .
 * Default is < code > true < / code > .
 * @ param shouldAddDefaultContentCharsetToContentTypeIfMissing Whether REST Assured should automatically append the content charset to the content - type header if not defined explicitly .
 * @ return A new { @ link EncoderConfig } instance */
public EncoderConfig appendDefaultContentCharsetToContentTypeIfUndefined ( boolean shouldAddDefaultContentCharsetToContentTypeIfMissing ) { } }

implementation: return new EncoderConfig ( defaultContentCharset , defaultQueryParameterCharset , shouldAddDefaultContentCharsetToContentTypeIfMissing , contentEncoders , contentTypeToDefaultCharset , true ) ;


signature:
public class EncoderConfig { /** * Encodes the content ( body ) of the request specified with the given < code > contentType < / code > with the same
 * encoder used by the supplied < code > encoder < / code > . This is useful only if REST Assured picks the wrong
 * encoder ( or can ' t recognize it ) for the given content - type .
 * @ param contentType The content - type to encode with a specific encoder .
 * @ param encoder The encoder to use for the given content - type .
 * @ return A new { @ link EncoderConfig } instance */
public EncoderConfig encodeContentTypeAs ( String contentType , ContentType encoder ) { } }

implementation: notNull ( contentType , "Content-Type to encode" ) ; notNull ( encoder , ContentType . class ) ; Map < String , ContentType > newMap = new HashMap < String , ContentType > ( contentEncoders ) ; newMap . put ( contentType , encoder ) ; return new EncoderConfig ( defaultContentCharset , defaultQueryParameterCharset , shouldAppendDefaultContentCharsetToContentTypeIfUndefined , newMap , contentTypeToDefaultCharset , true ) ;


signature:
public class ObjectMapperConfig { /** * Creates an object mapper configuration that uses the specified object mapper as default .
 * @ param defaultObjectMapperType The object mapper to use . If < code > null < / code > then classpath scanning will be used . */
public ObjectMapperConfig defaultObjectMapperType ( ObjectMapperType defaultObjectMapperType ) { } }

implementation: return new ObjectMapperConfig ( defaultObjectMapper , defaultObjectMapperType , gsonObjectMapperFactory , jackson1ObjectMapperFactory , jackson2ObjectMapperFactory , jaxbObjectMapperFactory , johnzonObjectMapperFactory , true ) ;


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


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


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


signature:
public class ObjectMapperConfig { /** * Specify a custom JAXB object mapper factory .
 * @ param jaxbObjectMapperFactory The object mapper factory */
public ObjectMapperConfig jaxbObjectMapperFactory ( JAXBObjectMapperFactory jaxbObjectMapperFactory ) { } }


signature:
public class RestAssuredMockMvcConfig { /** * Set the Log config .
 * @ param logConfig The { @ link LogConfig } to set
 * @ return An updated RestAssuredMockMvcConfig */
public RestAssuredMockMvcConfig logConfig ( LogConfig logConfig ) { } }

implementation: notNull ( logConfig , "Log config" ) ; return new RestAssuredMockMvcConfig ( logConfig , encoderConfig , decoderConfig , sessionConfig , objectMapperConfig , jsonConfig , xmlConfig , headerConfig , asyncConfig , multiPartConfig , mockMvcConfig , paramConfig , matcherConfig ) ;


signature:
public class RestAssuredMockMvcConfig { /** * Set the session config .
 * @ param sessionConfig The { @ link SessionConfig } to set
 * @ return An updated RestAssuredMockMvcConfig */
public RestAssuredMockMvcConfig sessionConfig ( SessionConfig sessionConfig ) { } }

implementation: notNull ( sessionConfig , "Session config" ) ; return new RestAssuredMockMvcConfig ( logConfig , encoderConfig , decoderConfig , sessionConfig , objectMapperConfig , jsonConfig , xmlConfig , headerConfig , asyncConfig , multiPartConfig , mockMvcConfig , paramConfig , matcherConfig ) ;


signature:
public class RestAssuredMockMvcConfig { /** * Set the object mapper config .
 * @ param objectMapperConfig The { @ link ObjectMapperConfig } to set
 * @ return An updated RestAssuredMockMvcConfig */
public RestAssuredMockMvcConfig objectMapperConfig ( ObjectMapperConfig objectMapperConfig ) { } }

implementation: notNull ( objectMapperConfig , "Object mapper config" ) ; return new RestAssuredMockMvcConfig ( logConfig , encoderConfig , decoderConfig , sessionConfig , objectMapperConfig , jsonConfig , xmlConfig , headerConfig , asyncConfig , multiPartConfig , mockMvcConfig , paramConfig , matcherConfig ) ;


signature:
public class RestAssuredMockMvcConfig { /** * Set the Json config .
 * @ param jsonConfig The { @ link JsonConfig } to set
 * @ return An updated RestAssuredMockMvcConfig */
public RestAssuredMockMvcConfig jsonConfig ( JsonConfig jsonConfig ) { } }

implementation: notNull ( jsonConfig , "JsonConfig" ) ; return new RestAssuredMockMvcConfig ( logConfig , encoderConfig , decoderConfig , sessionConfig , objectMapperConfig , jsonConfig , xmlConfig , headerConfig , asyncConfig , multiPartConfig , mockMvcConfig , paramConfig , matcherConfig ) ;


signature:
public class RestAssuredMockMvcConfig { /** * Set the Xml config .
 * @ param xmlConfig The { @ link XmlConfig } to set
 * @ return An updated RestAssuredMockMvcConfig */
public RestAssuredMockMvcConfig xmlConfig ( XmlConfig xmlConfig ) { } }

implementation: notNull ( xmlConfig , "XmlConfig" ) ; return new RestAssuredMockMvcConfig ( logConfig , encoderConfig , decoderConfig , sessionConfig , objectMapperConfig , jsonConfig , xmlConfig , headerConfig , asyncConfig , multiPartConfig , mockMvcConfig , paramConfig , matcherConfig ) ;


signature:
public class RestAssuredMockMvcConfig { /** * Set the encoder config
 * @ param encoderConfig The { @ link EncoderConfig } to set
 * @ return An updated RestAssuredMockMvcConfig */
public RestAssuredMockMvcConfig encoderConfig ( EncoderConfig encoderConfig ) { } }

implementation: notNull ( encoderConfig , "EncoderConfig" ) ; return new RestAssuredMockMvcConfig ( logConfig , encoderConfig , decoderConfig , sessionConfig , objectMapperConfig , jsonConfig , xmlConfig , headerConfig , asyncConfig , multiPartConfig , mockMvcConfig , paramConfig , matcherConfig ) ;


signature:
public class RestAssuredMockMvcConfig { /** * Set the header config
 * @ param headerConfig The { @ link HeaderConfig } to set
 * @ return An updated RestAssuredMockMvcConfig */
public RestAssuredMockMvcConfig headerConfig ( HeaderConfig headerConfig ) { } }

implementation: notNull ( headerConfig , "HeaderConfig" ) ; return new RestAssuredMockMvcConfig ( logConfig , encoderConfig , decoderConfig , sessionConfig , objectMapperConfig , jsonConfig , xmlConfig , headerConfig , asyncConfig , multiPartConfig , mockMvcConfig , paramConfig , matcherConfig ) ;


signature:
public class RestAssuredMockMvcConfig { /** * Set the async config
 * @ param asyncConfig The { @ link AsyncConfig } to set
 * @ return An updated RestAssuredMockMvcConfig */
public RestAssuredMockMvcConfig asyncConfig ( AsyncConfig asyncConfig ) { } }

implementation: notNull ( asyncConfig , AsyncConfig . class ) ; return new RestAssuredMockMvcConfig ( logConfig , encoderConfig , decoderConfig , sessionConfig , objectMapperConfig , jsonConfig , xmlConfig , headerConfig , asyncConfig , multiPartConfig , mockMvcConfig , paramConfig , matcherConfig ) ;


signature:
public class RestAssuredMockMvcConfig { /** * Set the MockMVC config
 * @ param mockMvcConfig The { @ link MockMvcConfig } to set
 * @ return An updated RestAssuredMockMvcConfig */
public RestAssuredMockMvcConfig mockMvcConfig ( MockMvcConfig mockMvcConfig ) { } }

implementation: notNull ( mockMvcConfig , MockMvcConfig . class ) ; return new RestAssuredMockMvcConfig ( logConfig , encoderConfig , decoderConfig , sessionConfig , objectMapperConfig , jsonConfig , xmlConfig , headerConfig , asyncConfig , multiPartConfig , mockMvcConfig , paramConfig , matcherConfig ) ;


signature:
public class RestAssuredMockMvcConfig { /** * Set the multi - part config
 * @ param multiPartConfig The { @ link MultiPartConfig } to set
 * @ return An updated RestAssuredMockMvcConfig */
public RestAssuredMockMvcConfig multiPartConfig ( MultiPartConfig multiPartConfig ) { } }

implementation: notNull ( multiPartConfig , MultiPartConfig . class ) ; return new RestAssuredMockMvcConfig ( logConfig , encoderConfig , decoderConfig , sessionConfig , objectMapperConfig , jsonConfig , xmlConfig , headerConfig , asyncConfig , multiPartConfig , mockMvcConfig , paramConfig , matcherConfig ) ;


signature:
public class RestAssuredMockMvcConfig { /** * Set the parameter config
 * @ param paramConfig The { @ link MockMvcParamConfig } to set
 * @ return An updated RestAssuredMockMvcConfig */
public RestAssuredMockMvcConfig paramConfig ( MockMvcParamConfig paramConfig ) { } }

implementation: notNull ( paramConfig , MultiPartConfig . class ) ; return new RestAssuredMockMvcConfig ( logConfig , encoderConfig , decoderConfig , sessionConfig , objectMapperConfig , jsonConfig , xmlConfig , headerConfig , asyncConfig , multiPartConfig , mockMvcConfig , paramConfig , matcherConfig ) ;


signature:
public class RestAssuredMockMvcConfig { /** * Set the matcher config
 * @ param matcherConfig The { @ link MockMvcParamConfig } to set
 * @ return An updated RestAssuredMockMvcConfig */
public RestAssuredMockMvcConfig matcherConfig ( MatcherConfig matcherConfig ) { } }

implementation: notNull ( matcherConfig , MatcherConfig . class ) ; return new RestAssuredMockMvcConfig ( logConfig , encoderConfig , decoderConfig , sessionConfig , objectMapperConfig , jsonConfig , xmlConfig , headerConfig , asyncConfig , multiPartConfig , mockMvcConfig , paramConfig , matcherConfig ) ;


signature:
public class UrlDecoder { /** * Decode / unescape a portion of a URL , to use with the query part ensure { @ code plusAsBlank } is true .
 * @ param content the portion to decode
 * @ param charset the charset to use
 * @ param plusAsBlank if { @ code true } , then convert ' + ' to space ( e . g . for www - url - form - encoded content ) , otherwise leave as is .
 * @ return encoded string */
public static String urlDecode ( final String content , final Charset charset , final boolean plusAsBlank ) { } }

implementation: if ( content == null ) { return null ; } final ByteBuffer bb = ByteBuffer . allocate ( content . length ( ) ) ; final CharBuffer cb = CharBuffer . wrap ( content ) ; while ( cb . hasRemaining ( ) ) { final char c = cb . get ( ) ; if ( c == '%' && cb . remaining ( ) >= 2 ) { final char uc = cb . get ( ) ; final char lc = cb . get ( ) ; final int u = Character . digit ( uc , 16 ) ; final int l = Character . digit ( lc , 16 ) ; if ( u != - 1 && l != - 1 ) { bb . put ( ( byte ) ( ( u << 4 ) + l ) ) ; } else { bb . put ( ( byte ) '%' ) ; bb . put ( ( byte ) uc ) ; bb . put ( ( byte ) lc ) ; } } else if ( plusAsBlank && c == '+' ) { bb . put ( ( byte ) ' ' ) ; } else { bb . put ( ( byte ) c ) ; } } bb . flip ( ) ; return charset . decode ( bb ) . toString ( ) ;


signature:
public class StatusCodeBasedLoggingFilter { /** * If body expectations are defined we need to return a new Response otherwise the stream
 * has been closed due to the logging . */
private Response cloneResponseIfNeeded ( Response response , byte [ ] responseAsString ) { } }

implementation: if ( responseAsString != null && response instanceof RestAssuredResponseImpl && ! ( ( RestAssuredResponseImpl ) response ) . getHasExpectations ( ) ) { final Response build = new ResponseBuilder ( ) . clone ( response ) . setBody ( responseAsString ) . build ( ) ; ( ( RestAssuredResponseImpl ) build ) . setHasExpectations ( true ) ; return build ; } return response ;


signature:
public class CertificateAuthSettings { /** * Configure the CertificateAuthSettings to use strict host name verification ( this is the default behavior ) .
 * @ return A new CertificateAuthSettings instance
 * @ see org . apache . http . conn . ssl . SSLSocketFactory # STRICT _ HOSTNAME _ VERIFIER */
public CertificateAuthSettings strictHostnames ( ) { } }

implementation: return new CertificateAuthSettings ( keystoreType , trustStoreType , port , trustStore , keyStore , STRICT_HOSTNAME_VERIFIER , sslSocketFactory ) ;


signature:
public class CertificateAuthSettings { /** * Configure the CertificateAuthSettings to allow all host names .
 * @ return A new CertificateAuthSettings instance
 * @ see org . apache . http . conn . ssl . SSLSocketFactory # ALLOW _ ALL _ HOSTNAME _ VERIFIER */
public CertificateAuthSettings allowAllHostnames ( ) { } }

implementation: return new CertificateAuthSettings ( keystoreType , trustStoreType , port , trustStore , keyStore , ALLOW_ALL_HOSTNAME_VERIFIER , sslSocketFactory ) ;


signature:
public class CertificateAuthSettings { /** * Configure the CertificateAuthSettings to use the provided { @ link X509HostnameVerifier } instance .
 * @ return A new CertificateAuthSettings instance
 * @ see org . apache . http . conn . ssl . SSLSocketFactory # ALLOW _ ALL _ HOSTNAME _ VERIFIER
 * @ see # allowAllHostnames ( ) */
public CertificateAuthSettings x509HostnameVerifier ( X509HostnameVerifier x509HostnameVerifier ) { } }

implementation: return new CertificateAuthSettings ( keystoreType , trustStoreType , port , trustStore , keyStore , x509HostnameVerifier , sslSocketFactory ) ;


signature:
public class XmlPathConfig { /** * 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 XmlPathConfig features ( Map < String , Boolean > features ) { } }

implementation: Validate . notNull ( features , "Features cannot be null" ) ; return new XmlPathConfig ( jaxbObjectMapperFactory , defaultParserType , defaultDeserializer , charset , features , declaredNamespaces , properties , validating , namespaceAware , allowDocTypeDeclaration ) ;


signature:
public class XmlPathConfig { /** * 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 XmlPathConfig instance
 * @ see org . xml . sax . XMLReader # setFeature ( java . lang . String , boolean ) */
public XmlPathConfig 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 XmlPathConfig ( jaxbObjectMapperFactory , defaultParserType , defaultDeserializer , charset , newFeatures , declaredNamespaces , properties , validating , namespaceAware , allowDocTypeDeclaration ) ;


signature:
public class XmlPathConfig { /** * 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 A new XmlPathConfig instance
 * @ see org . xml . sax . XMLReader # setFeature ( java . lang . String , boolean ) */
public XmlPathConfig properties ( Map < String , Object > properties ) { } }

implementation: Validate . notNull ( properties , "Properties cannot be null" ) ; return new XmlPathConfig ( jaxbObjectMapperFactory , defaultParserType , defaultDeserializer , charset , features , declaredNamespaces , properties , validating , namespaceAware , allowDocTypeDeclaration ) ;


signature:
public class XmlPathConfig { /** * Set a value of a property .
 * @ param name The property name
 * @ param value The value of the property
 * @ return A new XmlPathConfig instance
 * @ see org . xml . sax . XMLReader # setFeature ( java . lang . String , boolean ) */
public XmlPathConfig 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 XmlPathConfig ( jaxbObjectMapperFactory , defaultParserType , defaultDeserializer , charset , features , declaredNamespaces , newProperties , validating , namespaceAware , allowDocTypeDeclaration ) ;


signature:
public class XmlPathConfig { /** * 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 XmlPathConfig instance
 * @ see # feature ( String , boolean ) */
public XmlPathConfig disableLoadingOfExternalDtd ( ) { } }

implementation: Map < String , Boolean > newFeatures = new HashMap < String , Boolean > ( features ) ; newFeatures . put ( "http://apache.org/xml/features/nonvalidating/load-external-dtd" , false ) ; newFeatures . put ( "http://apache.org/xml/features/disallow-doctype-decl" , false ) ; return new XmlPathConfig ( jaxbObjectMapperFactory , defaultParserType , defaultDeserializer , charset , newFeatures , declaredNamespaces , properties , validating , namespaceAware , allowDocTypeDeclaration ) ;


signature:
public class XmlPathConfig { /** * 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 XmlPathConfig defaultObjectDeserializer ( XmlPathObjectDeserializer defaultObjectDeserializer ) { } }

implementation: return new XmlPathConfig ( jaxbObjectMapperFactory , defaultParserType , defaultObjectDeserializer , charset , features , declaredNamespaces , properties , validating , namespaceAware , allowDocTypeDeclaration ) ;


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

implementation: return new XmlPathConfig ( jaxbObjectMapperFactory , defaultParserType , defaultDeserializer , charset , features , namespacesToDeclare , properties , validating , namespaceAware , allowDocTypeDeclaration ) ;


signature:
public class XmlPathConfig { /** * Declares a namespace .
 * @ 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 XmlPathConfig instance
 * @ see org . xml . sax . XMLReader # setFeature ( java . lang . String , boolean ) */
public XmlPathConfig declaredNamespace ( 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 XmlPathConfig ( jaxbObjectMapperFactory , defaultParserType , defaultDeserializer , charset , features , updatedNamespaces , properties , validating , true , allowDocTypeDeclaration ) ;


signature:
public class HTTPBuilder { /** * < p > Convenience method to perform an HTTP GET . It will use the HTTPBuilder ' s
 * { @ link # getHandler ( ) registered response handlers } to handle success or
 * failure status codes . By default , the < code > success < / code > response
 * handler will attempt to parse the data and simply return the parsed
 * object . < / p >
 * < p > < strong > Note : < / strong > If using the { @ link # defaultSuccessHandler ( HttpResponseDecorator , Object )
 * default < code > success < / code > response handler } , be sure to read the
 * caveat regarding streaming response data . < / p >
 * @ param args see { @ link RequestConfigDelegate # setPropertiesFromMap ( Map ) }
 * @ return whatever was returned from the response closure .
 * @ throws URISyntaxException if a uri argument is given which does not
 * represent a valid URI
 * @ throws IOException
 * @ throws ClientProtocolException
 * @ see # getHandler ( )
 * @ see # defaultSuccessHandler ( HttpResponseDecorator , Object )
 * @ see # defaultFailureHandler ( HttpResponseDecorator ) */
public Object get ( Map < String , ? > args ) throws ClientProtocolException , IOException , URISyntaxException { } }

implementation: return this . get ( args , null ) ;


signature:
public class HTTPBuilder { /** * < p > Convenience method to perform an HTTP GET . The response closure will
 * be called only on a successful response . < / p >
 * < p > A ' failed ' response ( i . e . any HTTP status code > 399 ) will be handled
 * by the registered ' failure ' handler . The
 * { @ link # defaultFailureHandler ( HttpResponseDecorator ) default failure handler }
 * throws an { @ link HttpResponseException } . < / p >
 * @ param args see { @ link RequestConfigDelegate # setPropertiesFromMap ( Map ) }
 * @ param responseClosure code to handle a successful HTTP response
 * @ return any value returned by the response closure .
 * @ throws ClientProtocolException
 * @ throws IOException
 * @ throws URISyntaxException if a uri argument is given which does not
 * represent a valid URI */
public Object get ( Map < String , ? > args , Closure responseClosure ) throws ClientProtocolException , IOException , URISyntaxException { } }

implementation: RequestConfigDelegate delegate = new RequestConfigDelegate ( new HttpGet ( ) , this . defaultContentType , this . defaultRequestHeaders , this . defaultResponseHandlers ) ; delegate . setPropertiesFromMap ( args ) ; if ( responseClosure != null ) delegate . getResponse ( ) . put ( Status . SUCCESS , responseClosure ) ; return this . doRequest ( delegate ) ;


signature:
public class HTTPBuilder { /** * < p > Convenience method to perform an HTTP POST . It will use the HTTPBuilder ' s
 * { @ link # getHandler ( ) registered response handlers } to handle success or
 * failure status codes . By default , the < code > success < / code > response
 * handler will attempt to parse the data and simply return the parsed
 * object . < / p >
 * < p > < strong > Note : < / strong > If using the { @ link # defaultSuccessHandler ( HttpResponseDecorator , Object )
 * default < code > success < / code > response handler } , be sure to read the
 * caveat regarding streaming response data . < / p >
 * @ param args see { @ link RequestConfigDelegate # setPropertiesFromMap ( Map ) }
 * @ return whatever was returned from the response closure .
 * @ throws IOException
 * @ throws URISyntaxException if a uri argument is given which does not
 * represent a valid URI
 * @ throws ClientProtocolException
 * @ see # getHandler ( )
 * @ see # defaultSuccessHandler ( HttpResponseDecorator , Object )
 * @ see # defaultFailureHandler ( HttpResponseDecorator ) */
public Object post ( Map < String , ? > args ) throws ClientProtocolException , URISyntaxException , IOException { } }

implementation: return this . post ( args , null ) ;


signature:
public class HTTPBuilder { /** * < p > Convenience method to perform an HTTP PATCH . It will use the HTTPBuilder ' s
 * { @ link # getHandler ( ) registered response handlers } to handle success or
 * failure status codes . By default , the < code > success < / code > response
 * handler will attempt to parse the data and simply return the parsed
 * object . < / p >
 * < p > < strong > Note : < / strong > If using the { @ link # defaultSuccessHandler ( HttpResponseDecorator , Object )
 * default < code > success < / code > response handler } , be sure to read the
 * caveat regarding streaming response data . < / p >
 * @ param args see { @ link RequestConfigDelegate # setPropertiesFromMap ( Map ) }
 * @ return whatever was returned from the response closure .
 * @ throws IOException
 * @ throws URISyntaxException if a uri argument is given which does not
 * represent a valid URI
 * @ throws ClientProtocolException
 * @ see # getHandler ( )
 * @ see # defaultSuccessHandler ( HttpResponseDecorator , Object )
 * @ see # defaultFailureHandler ( HttpResponseDecorator ) */
public Object patch ( Map < String , ? > args ) throws ClientProtocolException , URISyntaxException , IOException { } }

implementation: return this . patch ( args , null ) ;


signature:
public class HTTPBuilder { /** * Convenience method to perform an HTTP form PATCH . The response closure will be
 * called only on a successful response . < / p >
 * < p > A ' failed ' response ( i . e . any
 * HTTP status code > 399 ) will be handled by the registered ' failure '
 * handler . The { @ link # defaultFailureHandler ( HttpResponseDecorator ) default
 * failure handler } throws an { @ link HttpResponseException } . < / p >
 * < p > The request body ( specified by a < code > body < / code > named parameter )
 * will be converted to a url - encoded form string unless a different
 * < code > requestContentType < / code > named parameter is passed to this method .
 * ( See { @ link EncoderRegistry # encodeForm ( Map ) } . ) < / p >
 * @ param args see { @ link RequestConfigDelegate # setPropertiesFromMap ( Map ) }
 * @ param responseClosure code to handle a successful HTTP response
 * @ return any value returned by the response closure .
 * @ throws ClientProtocolException
 * @ throws IOException
 * @ throws URISyntaxException if a uri argument is given which does not
 * represent a valid URI */
public Object patch ( Map < String , ? > args , Closure responseClosure ) throws URISyntaxException , ClientProtocolException , IOException { } }

implementation:
RequestConfigDelegate delegate = new RequestConfigDelegate ( new HttpPatch ( ) , this . defaultContentType , this . defaultRequestHeaders , this . defaultResponseHandlers ) ; /* by default assume the request body will be URLEncoded , but allow
 the ' requestContentType ' named argument to override this if it is
 given */
delegate . setRequestContentType ( ContentType . URLENC . toString ( ) ) ; delegate . setPropertiesFromMap ( args ) ; if ( responseClosure != null ) { delegate . getResponse ( ) . put ( Status . SUCCESS . toString ( ) , responseClosure ) ; delegate . getResponse ( ) . put ( Status . FAILURE . toString ( ) , responseClosure ) ; } return this . doRequest ( delegate ) ;


signature:
public class HTTPBuilder { /** * Make an HTTP request to the default URI , and parse using the default
 * content - type .
 * @ param method { @ link HttpRequestFactory HTTP method }
 * @ param configClosure request configuration options
 * @ return whatever value was returned by the executed response handler .
 * @ throws ClientProtocolException
 * @ throws IOException
 * @ see # request ( Object , HttpRequestFactory , Object , Closure ) */
public Object request ( String method , boolean hasBody , Closure configClosure ) throws ClientProtocolException , IOException { } }

implementation: return this . doRequest ( this . defaultURI . toURI ( ) , method , this . defaultContentType , hasBody , configClosure ) ;


signature:
public class HTTPBuilder { /** * Make a request for the given HTTP method and content - type , with
 * additional options configured in the < code > configClosure < / code > . See
 * { @ link RequestConfigDelegate } for options .
 * @ param uri either a { @ link URL } , { @ link URI } or object whose
 * < code > toString ( ) < / code > produces a valid URI string . See
 * { @ link URIBuilder # convertToURI ( Object ) } .
 * @ param method { @ link HttpRequestFactory HTTP method }
 * @ param contentType either a { @ link ContentType } or valid content - type string .
 * @ param configClosure closure from which to configure options like
 * { @ link RequestConfigDelegate # getUri ( ) uri . path } ,
 * { @ link URIBuilder # setQuery ( Map ) request parameters } ,
 * { @ link RequestConfigDelegate # setHeaders ( Map ) headers } ,
 * { @ link RequestConfigDelegate # setBody ( Object , Object ) request body } and
 * { @ link RequestConfigDelegate # getResponse ( ) response handlers } .
 * @ return whatever value was returned by the executed response handler .
 * @ throws ClientProtocolException
 * @ throws IOException
 * @ throws URISyntaxException if the uri argument does not represent a valid URI */
public Object request ( Object uri , String method , Object contentType , boolean hasBody , Closure configClosure ) throws ClientProtocolException , IOException , URISyntaxException { } }

implementation: return this . doRequest ( URIBuilder . convertToURI ( uri ) , method , contentType , hasBody , configClosure ) ;


signature:
public class HTTPBuilder { /** * Create a { @ link RequestConfigDelegate } from the given arguments , execute the
 * config closure , then pass the delegate to { @ link # doRequest ( RequestConfigDelegate ) } ,
 * which actually executes the request . */
protected Object doRequest ( URI uri , String method , Object contentType , boolean hasBody , Closure configClosure ) throws IOException { } }

implementation: HttpRequestBase reqMethod = HttpRequestFactory . createHttpRequest ( uri , method , hasBody ) ; RequestConfigDelegate delegate = new RequestConfigDelegate ( reqMethod , contentType , this . defaultRequestHeaders , this . defaultResponseHandlers ) ; configClosure . setDelegate ( delegate ) ; configClosure . setResolveStrategy ( Closure . DELEGATE_FIRST ) ; configClosure . call ( reqMethod ) ; return this . doRequest ( delegate ) ;


signature:
public class HTTPBuilder { /** * Parse the response data based on the given content - type .
 * If the given content - type is { @ link ContentType # ANY } , the
 * < code > content - type < / code > header from the response will be used to
 * determine how to parse the response .
 * @ param resp
 * @ param contentType
 * @ return whatever was returned from the parser retrieved for the given
 * content - type , or < code > null < / code > if no parser could be found for this
 * content - type . The parser will also return < code > null < / code > if the
 * response does not contain any content ( e . g . in response to a HEAD request ) .
 * @ throws HttpResponseException if there is a error parsing the response */
protected Object parseResponse ( HttpResponse resp , Object contentType ) throws IOException { } }

implementation:
// For HEAD or OPTIONS requests , there should be no response entity .
if ( resp . getEntity ( ) == null ) { log . debug ( "Response contains no entity.  Parsed data is null." ) ; return null ; } // first , start with the _ given _ content - type
String responseContentType = contentType . toString ( ) ; // if the given content - type is ANY ( " * / * " ) then use the response content - type
try { if ( ContentType . ANY . toString ( ) . equals ( responseContentType ) ) responseContentType = HttpResponseContentTypeFinder . findContentType ( resp ) ; } catch ( RuntimeException ex ) { /* if for whatever reason we can ' t determine the content - type , but
 * still want to attempt to parse the data , use the BINARY
 * content - type so that the response will be buffered into a
 * ByteArrayInputStream . */
responseContentType = ContentType . BINARY . toString ( ) ; } Object parsedData = null ; log . debug ( "Parsing response as: " + responseContentType ) ; parsedData = resp . getEntity ( ) . getContent ( ) ; if ( parsedData == null ) log . debug ( "Parser returned null!" ) ; else log . debug ( "Parsed data to instance of: " + parsedData . getClass ( ) ) ; return parsedData ;


signature:
public class HTTPBuilder { /** * Creates default response handlers for { @ link Status # SUCCESS success } and
 * { @ link Status # FAILURE failure } status codes . This is used to populate
 * the handler map when a new HTTPBuilder instance is created .
 * @ return the default response handler map .
 * @ see # defaultSuccessHandler ( HttpResponseDecorator , Object )
 * @ see # defaultFailureHandler ( HttpResponseDecorator ) */
protected Map < Object , Closure > buildDefaultResponseHandlers ( ) { } }

implementation: Map < Object , Closure > map = new StringHashMap < Closure > ( ) ; map . put ( Status . SUCCESS , new MethodClosure ( this , "defaultSuccessHandler" ) ) ; map . put ( Status . FAILURE , new MethodClosure ( this , "defaultFailureHandler" ) ) ; return map ;


signature:
public class HTTPBuilder { /** * < p > This is the default < code > response . success < / code > handler . It will be
 * executed if the response is not handled by a status - code - specific handler
 * ( i . e . < code > response . ' 200 ' = { . . } < / code > ) and no generic ' success ' handler
 * is given ( i . e . < code > response . success = { . . } < / code > . ) This handler simply
 * returns the parsed data from the response body . In most cases you will
 * probably want to define a < code > response . success = { . . . } < / code > handler
 * from the request closure , which will replace the response handler defined
 * by this method . < / p >
 * < p > In practice , a user - supplied response handler closure is
 * < i > designed < / i > to handle streaming content so it can be read directly from
 * the response stream without buffering , which will be much more efficient .
 * Therefore , it is recommended that request method variants be used which
 * explicitly accept a response handler closure in these cases . < / p >
 * @ param resp HTTP response
 * @ param parsedData parsed data as resolved from this instance ' s { @ link HttpResponseContentTypeFinder }
 * @ return the parsed data object ( whatever the parser returns ) .
 * @ throws ResponseParseException if there is an error buffering a streaming
 * response . */
protected Object defaultSuccessHandler ( HttpResponseDecorator resp , Object parsedData ) throws ResponseParseException { } }

implementation:
try { // If response is streaming , buffer it in a byte array :
if ( parsedData instanceof InputStream ) { ByteArrayOutputStream buffer = new ByteArrayOutputStream ( ) ; DefaultGroovyMethods . leftShift ( buffer , ( InputStream ) parsedData ) ; parsedData = new ByteArrayInputStream ( buffer . toByteArray ( ) ) ; } else if ( parsedData instanceof Reader ) { StringWriter buffer = new StringWriter ( ) ; DefaultGroovyMethods . leftShift ( buffer , ( Reader ) parsedData ) ; parsedData = new StringReader ( buffer . toString ( ) ) ; } else if ( parsedData instanceof Closeable ) log . debug ( "Parsed data is streaming, but will be accessible after " + "the network connection is closed.  Use at your own risk!" ) ; return parsedData ; } catch ( IOException ex ) { throw new ResponseParseException ( resp , ex ) ; }


signature:
public class HTTPBuilder { /** * Set the default URI used for requests that do not explicitly take a
 * < code > uri < / code > param .
 * @ param uri either a { @ link URL } , { @ link URI } or object whose
 * < code > toString ( ) < / code > produces a valid URI string . See
 * { @ link URIBuilder # convertToURI ( Object ) } .
 * @ throws URISyntaxException if the uri argument does not represent a valid URI */
public void setUri ( Object uri ) throws URISyntaxException { } }

implementation: this . defaultURI = new URIBuilder ( URIBuilder . convertToURI ( uri ) , urlEncodingEnabled , encoderConfig ) ;


signature:
public class HTTPBuilder { /** * Set the default headers to add to all requests made by this builder
 * instance . These values will replace any previously set default headers .
 * @ param headers map of header names & values . */
public void setHeaders ( Map < ? , ? > headers ) { } }

implementation: this . defaultRequestHeaders . clear ( ) ; if ( headers == null ) return ; for ( Object key : headers . keySet ( ) ) { Object val = headers . get ( key ) ; if ( val == null ) continue ; this . defaultRequestHeaders . put ( key . toString ( ) , val . toString ( ) ) ; }


signature:
public class HTTPBuilder { /** * Set the default HTTP proxy to be used for all requests .
 * @ param host host name or IP
 * @ param port port , or - 1 for the default port
 * @ param scheme usually " http " or " https , " or < code > null < / code > for the default
 * @ see HttpHost # HttpHost ( String , int , String ) */
public void setProxy ( String host , int port , String scheme ) { } }

implementation: getClient ( ) . getParams ( ) . setParameter ( ConnRoutePNames . DEFAULT_PROXY , new HttpHost ( host , port , scheme ) ) ;


signature:
public class MultiPartSpecBuilder { /** * Specify the control name of this multi - part .
 * @ param controlName The control name to use . Default is < code > file < / code > .
 * @ return An instance of MultiPartSpecBuilder */
public MultiPartSpecBuilder controlName ( String controlName ) { } }

implementation: Validate . notEmpty ( controlName , "Control name cannot be empty" ) ; this . controlName = controlName ; this . isControlNameExplicit = true ; return this ;


signature:
public class MultiPartSpecBuilder { /** * Add a header to this multipart specification .
 * @ param name The name of the header
 * @ param value The value of the header
 * @ return An instance of MultiPartSpecBuilder */
public MultiPartSpecBuilder header ( String name , String value ) { } }

implementation:
Validate . notEmpty ( name , "Header name cannot be empty" ) ; Validate . notEmpty ( value , "Header value cannot be empty" ) ; // Replace previous header if exists
final Set < String > headerNames = headers . keySet ( ) ; final String trimmedName = name . trim ( ) ; for ( String headerName : headerNames ) { if ( headerName . equalsIgnoreCase ( trimmedName ) ) { headers . remove ( headerName ) ; } } // Put the name header in the header list
headers . put ( name , value ) ; return this ;


signature:
public class MultiPartSpecBuilder { /** * Set the headers for this multipart specification ( replaces previous headers )
 * @ param headers The headers as a map
 * @ return An instance of MultiPartSpecBuilder */
public MultiPartSpecBuilder headers ( Map < String , String > headers ) { } }

implementation: if ( headers == null ) { this . headers = new HashMap < String , String > ( ) ; } else { this . headers = new HashMap < String , String > ( headers ) ; } return this ;


signature:
public class MultiPartSpecBuilder { /** * Specify the charset for this charset .
 * @ param charset The charset to use
 * @ return An instance of MultiPartSpecBuilder */
public MultiPartSpecBuilder charset ( String charset ) { } }

implementation: Validate . notEmpty ( charset , "Charset cannot be empty" ) ; if ( content instanceof byte [ ] || content instanceof InputStream ) { throw new IllegalArgumentException ( "Cannot specify charset input streams or byte arrays." ) ; } this . charset = charset ; return this ;


signature:
public class MultiPartSpecBuilder { /** * Specify the charset for this charset .
 * @ param charset The charset to use
 * @ return An instance of MultiPartSpecBuilder */
public MultiPartSpecBuilder charset ( Charset charset ) { } }

implementation: Validate . notNull ( charset , "Charset cannot be null" ) ; this . charset = charset . toString ( ) ; return this ;


signature:
public class ContentEncodingRegistry { /** * This implementation adds a { @ link GZIPEncoding } and { @ link DeflateEncoding }
 * handler to the registry . Override this method to provide a different set
 * of defaults .
 * @ return a map to content - encoding strings to { @ link ContentEncoding } handlers . */
protected Map < String , ContentEncoding > getDefaultEncoders ( ) { } }

implementation: Map < String , ContentEncoding > map = new HashMap < String , ContentEncoding > ( ) ; map . put ( Type . GZIP . toString ( ) , new GZIPEncoding ( ) ) ; map . put ( Type . DEFLATE . toString ( ) , new DeflateEncoding ( useNoWrapForInflateDecoding ) ) ; return map ;


signature:
public class ContentEncodingRegistry { /** * Add the request and response interceptors to the { @ link HttpClient } ,
 * which will provide transparent decoding of the given content - encoding
 * types . This method is called by HTTPBuilder and probably should not need
 * be modified by sub - classes .
 * @ param client client on which to set the request and response interceptors
 * @ param encodings encoding name ( either a { @ link ContentEncoding . Type } or
 * a < code > content - encoding < / code > string . */
void setInterceptors ( final AbstractHttpClient client , Object ... encodings ) { } }

implementation:
// remove any encoding interceptors that are already set
client . removeRequestInterceptorByClass ( ContentEncoding . RequestInterceptor . class ) ; client . removeResponseInterceptorByClass ( ContentEncoding . ResponseInterceptor . class ) ; for ( Object encName : encodings ) { ContentEncoding enc = availableEncoders . get ( encName . toString ( ) ) ; if ( enc == null ) continue ; client . addRequestInterceptor ( enc . getRequestInterceptor ( ) ) ; client . addResponseInterceptor ( enc . getResponseInterceptor ( ) ) ; }


signature:
public class AuthConfig { /** * Set authentication credentials to be used for the current
 * { @ link HTTPBuilder # getUri ( ) default host } . This method name is a bit of
 * a misnomer , since these credentials will actually work for " digest "
 * authentication as well .
 * @ param user
 * @ param pass */
public void basic ( String user , String pass ) { } }

implementation: URI uri = ( ( URIBuilder ) builder . getUri ( ) ) . toURI ( ) ; if ( uri == null ) throw new IllegalStateException ( "a default URI must be set" ) ; this . basic ( uri . getHost ( ) , uri . getPort ( ) , user , pass ) ;


signature:
public class AuthConfig { /** * Set authentication credentials to be used for the given host and port .
 * @ param host
 * @ param port
 * @ param user
 * @ param pass */
public void basic ( String host , int port , String user , String pass ) { } }

implementation: builder . getClient ( ) . getCredentialsProvider ( ) . setCredentials ( new AuthScope ( host , port ) , new UsernamePasswordCredentials ( user , pass ) ) ;


signature:
public class AuthConfig { /** * Set NTLM authentication credentials to be used for the current
 * { @ link HTTPBuilder # getUri ( ) default host } .
 * @ param user
 * @ param pass */
public void ntlm ( String user , String pass , String workstation , String domain ) { } }

implementation: URI uri = ( ( URIBuilder ) builder . getUri ( ) ) . toURI ( ) ; if ( uri == null ) throw new IllegalStateException ( "a default URI must be set" ) ; this . ntlm ( uri . getHost ( ) , uri . getPort ( ) , user , pass , workstation , domain ) ;


signature:
public class AuthConfig { /** * Set NTLM authentication credentials to be used for the given host and port .
 * @ param host
 * @ param port
 * @ param user
 * @ param pass
 * @ param workstation
 * @ param domain */
public void ntlm ( String host , int port , String user , String pass , String workstation , String domain ) { } }

implementation: builder . getClient ( ) . getCredentialsProvider ( ) . setCredentials ( new AuthScope ( host , port ) , new NTCredentials ( user , pass , workstation , domain ) ) ;


signature:
public class AuthConfig { /** * Sets a certificate to be used for SSL authentication . See { @ link Class # getResource ( String ) } for how to get a URL from a resource
 * on the classpath .
 * @ param keyStorePath URL to a JKS keystore where the certificate is stored .
 * @ param keyStorePassword password to decrypt the keystore
 * @ param keyStoreType The certificate type
 * @ param keyStore The key store
 * @ param trustStorePath URL to a trust store
 * @ param trustStorePassword password to decrypt the trust store
 * @ param trustStoreType The certificate type
 * @ param trustStore The trust store
 * @ param port The SSL port
 * @ param hostnameVerifier The X509HostnameVerifier to use
 * @ param sslConnectionSocketFactory The SSLConnectionSocketFactory to use */
public void certificate ( Object keyStorePath , String keyStorePassword , String keyStoreType , KeyStore keyStore , Object trustStorePath , String trustStorePassword , String trustStoreType , KeyStore trustStore , int port , X509HostnameVerifier hostnameVerifier , SSLSocketFactory sslConnectionSocketFactory ) { } }

implementation: TrustAndKeystoreSpecImpl spec = new TrustAndKeystoreSpecImpl ( ) ; URI uri = ( ( URIBuilder ) builder . getUri ( ) ) . toURI ( ) ; if ( uri == null ) throw new IllegalStateException ( "a default URI must be set" ) ; spec . setKeyStoreType ( keyStoreType ) ; spec . setKeyStorePassword ( keyStorePassword ) ; spec . setKeyStorePath ( keyStorePath ) ; spec . setKeyStore ( keyStore ) ; spec . setTrustStoreType ( trustStoreType ) ; spec . setTrustStorePassword ( trustStorePassword ) ; spec . setTrustStorePath ( trustStorePath ) ; spec . setTrustStore ( trustStore ) ; spec . setPort ( port ) ; spec . setX509HostnameVerifier ( hostnameVerifier ) ; spec . setFactory ( sslConnectionSocketFactory ) ; int portSpecifiedInUri = uri . getPort ( ) ; spec . apply ( builder , portSpecifiedInUri == UNDEFINED_PORT ? DEFAULT_HTTPS_PORT : portSpecifiedInUri ) ;


signature:
public class AuthConfig { /** * < / p > OAuth sign all requests . Note that this currently does < strong > not < / strong >
 * wait for a < code > WWW - Authenticate < / code > challenge before sending the
 * the OAuth header . All requests to all domains will be signed for this
 * instance . < / p >
 * < p > This assumes you ' ve already generated an < code > accessToken < / code > and
 * < code > secretToken < / code > for the site you ' re targeting . For More information
 * on how to achieve this , see the
 * < a href = ' https : / / github . com / scribejava / scribejava / wiki / Getting - Started ' > Scribe documentation < / a > . < / p >
 * @ param consumerKey < code > null < / code > if you want to < strong > unset < / strong >
 * OAuth handling and stop signing requests .
 * @ param consumerSecret
 * @ param accessToken
 * @ param secretToken
 * @ since 0.5.1 */
public void oauth ( String consumerKey , String consumerSecret , String accessToken , String secretToken ) { } }

implementation: this . builder . client . removeRequestInterceptorByClass ( OAuthSigner . class ) ; if ( consumerKey != null ) { this . builder . client . addRequestInterceptor ( new OAuthSigner ( consumerKey , consumerSecret , accessToken , secretToken , OAuthSignature . HEADER , raOAuthConfig . shouldAddEmptyAccessOAuthTokenToBaseString ( ) ) ) ; }


signature:
public class AuthConfig { /** * < / p > OAuth2 sign all requests . Note that this currently does < strong > not < / strong >
 * wait for a < code > WWW - Authenticate < / code > challenge before sending the
 * the OAuth header . All requests to all domains will be signed for this
 * instance . < / p >
 * < p > This assumes you ' ve already generated an < code > accessToken < / code >
 * for the site you ' re targeting . For More information
 * on how to achieve this , see the
 * < a href = ' https : / / github . com / scribejava / scribejava / wiki / Getting - Started ' > Scribe documentation < / a > . < / p >
 * @ param accessToken
 * @ since 0.5.1 */
public void oauth2 ( String accessToken ) { } }

implementation: this . builder . client . removeRequestInterceptorByClass ( OAuthSigner . class ) ; if ( accessToken != null ) { this . builder . client . addRequestInterceptor ( new OAuthSigner ( accessToken , OAuthSignature . HEADER ) ) ; }


signature:
public class HttpResponseContentTypeFinder { /** * Helper method to get the content - type string from the response
 * ( no charset ) .
 * @ param resp */
public static String findContentType ( HttpResponse resp ) { } }

implementation:
Header contentTypeHeader = resp . getFirstHeader ( HttpHeaders . CONTENT_TYPE ) ; if ( contentTypeHeader == null ) throw new IllegalArgumentException ( "Response does not have a content-type header" ) ; try { return contentTypeHeader . getValue ( ) ; } catch ( RuntimeException ex ) { // NPE or OOB Exceptions
throw new IllegalArgumentException ( "Could not parse content-type from response" ) ; }


signature:
public class Headers { /** * An alternative way to create a Headers object from the constructor .
 * @ param header The header to be included
 * @ param additionalHeaders Additional headers to be included ( optional )
 * @ return A new headers object containing the specified headers */
public static Headers headers ( Header header , Header ... additionalHeaders ) { } }

implementation: notNull ( header , "Header" ) ; final List < Header > headerList = new LinkedList < Header > ( ) ; headerList . add ( header ) ; if ( additionalHeaders != null ) { Collections . addAll ( headerList , additionalHeaders ) ; } return new Headers ( headerList ) ;


signature:
public class RestAssuredMockMvc { /** * This is usually the entry - point of the API if you need to specify parameters or a body in the request . For example :
 * < pre >
 * given ( ) .
 * param ( " x " , " y " ) .
 * when ( ) .
 * get ( " / something " ) .
 * then ( ) .
 * statusCode ( 200 ) .
 * body ( " x . y " , notNullValue ( ) ) ;
 * < / pre >
 * Note that this method is the same as { @ link # with ( ) } but with another syntax .
 * @ return A { @ link MockMvcRequestSpecification } . */
public static MockMvcRequestSpecification given ( ) { } }

implementation: return new MockMvcRequestSpecificationImpl ( mockMvcFactory , config , resultHandlers , requestPostProcessors , basePath , requestSpecification , responseSpecification , authentication ) ;


signature:
public class RestAssuredMockMvc { /** * Reset all static configurations to their default values . */
public static void reset ( ) { } }

implementation: mockMvcFactory = null ; config = null ; basePath = "/" ; resultHandlers . clear ( ) ; requestPostProcessors . clear ( ) ; responseSpecification = null ; requestSpecification = null ; authentication = null ;


signature:
public class RestAssuredMockMvc { /** * Perform a GET 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 > get ( " / book / { hotelName } / { roomNumber } " , " Hotels R Us " , 22 ) ; < / code > .
 * @ return The response of the GET request . */
public static MockMvcResponse get ( String path , Object ... pathParams ) { } }

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


signature:
public class RestAssuredMockMvc { /** * Perform a GET 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 GET request . */
public static MockMvcResponse get ( String path , Map < String , ? > pathParams ) { } }


signature:
public class RestAssuredMockMvc { /** * Perform a POST 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 > post ( " / book / { hotelName } / { roomNumber } " , " Hotels R Us " , 22 ) ; < / code > .
 * @ return The response of the request . */
public static MockMvcResponse post ( String path , Object ... pathParams ) { } }

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


signature:
public class RestAssuredMockMvc { /** * Perform a POST 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 post ( String path , Map < String , ? > pathParams ) { } }


signature:
public class RestAssuredMockMvc { /** * Perform a PUT 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 > put ( " / book / { hotelName } / { roomNumber } " , " Hotels R Us " , 22 ) ; < / code > .
 * @ return The response of the request . */
public static MockMvcResponse put ( String path , Object ... pathParams ) { } }

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


signature:
public class RestAssuredMockMvc { /** * Perform a DELETE 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 > delete ( " / book / { hotelName } / { roomNumber } " , " Hotels R Us " , 22 ) ; < / code > .
 * @ return The response of the request . */
public static MockMvcResponse delete ( String path , Object ... pathParams ) { } }

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


signature:
public class RestAssuredMockMvc { /** * Perform a DELETE 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 delete ( String path , Map < String , ? > pathParams ) { } }