Package org.springframework.test.http

# Class HttpHeadersAssert

java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
org.assertj.core.api.AbstractObjectAssert<SELF,ACTUAL>
org.assertj.core.api.AbstractMapAssert<HttpHeadersAssert,org.springframework.http.HttpHeaders,String,List<String>>
org.springframework.test.http.HttpHeadersAssert

All Implemented Interfaces:
  `org.assertj.core.api.Assert<HttpHeadersAssert,org.springframework.http.HttpHeaders>`, `org.assertj.core.api.Descriptable<HttpHeadersAssert>`, `org.assertj.core.api.EnumerableAssert<HttpHeadersAssert,Map.Entry<? extends String,? extends List<String>>>`, `org.assertj.core.api.ExtensionPoints<HttpHeadersAssert,org.springframework.http.HttpHeaders>`

public class HttpHeadersAssert extends org.assertj.core.api.AbstractMapAssert<HttpHeadersAssert,org.springframework.http.HttpHeaders,String,List<String>>
AssertJ `assertions` that can be applied to `HttpHeaders`.

Since:
  6.2
Author:
  Stephane Nicoll

## Field Summary

### Fields inherited from class org.assertj.core.api.AbstractAssert

`actual, info, myself, objects, throwUnsupportedExceptionOnEquals`

## Constructor Summary

Constructors
Constructor
Description
`HttpHeadersAssert(org.springframework.http.HttpHeaders actual)`

## Method Summary

Modifier and Type
Method
Description
`HttpHeadersAssert`
`containsHeader(String name)`
Verify that the actual HTTP headers contain a header with the given `name`.
`HttpHeadersAssert`
`containsHeaders(String... names)`
Verify that the actual HTTP headers contain the headers with the given `names`.
`HttpHeadersAssert`
`doesNotContainHeader(String name)`
Verify that the actual HTTP headers do not contain a header with the given `name`.
`HttpHeadersAssert`
`doesNotContainHeaders(String... names)`
Verify that the actual HTTP headers do not contain any of the headers with the given `names`.
`HttpHeadersAssert`
`doesNotContainsHeaders(String... names)`
Deprecated, for removal: This API element is subject to removal in a future version.
in favor of `doesNotContainHeaders(String...)`
`HttpHeadersAssert`
`hasValue(String name, long value)`
Verify that the actual HTTP headers contain a header with the given `name` and `long` `value`.
`HttpHeadersAssert`
`hasValue(String name, String value)`
Verify that the actual HTTP headers contain a header with the given `name` and `String` `value`.
`HttpHeadersAssert`
`hasValue(String name, Instant value)`
Verify that the actual HTTP headers contain a header with the given `name` and `Instant` `value`.

### Methods inherited from class org.assertj.core.api.AbstractMapAssert

`allSatisfy, anySatisfy, as, as, contains, containsAllEntriesOf, containsAnyOf, containsAnyOfForProxy, containsEntry, containsExactly, containsExactlyEntriesOf, containsExactlyForProxy, containsExactlyInAnyOrderEntriesOf, containsForProxy, containsKey, containsKeys, containsKeysForProxy, containsOnly, containsOnlyForProxy, containsOnlyKeys, containsOnlyKeys, containsOnlyKeysForProxy, containsValue, containsValues, containsValuesForProxy, describedAs, describedAs, doesNotContain, doesNotContainEntry, doesNotContainForProxy, doesNotContainKey, doesNotContainKeys, doesNotContainKeysForProxy, doesNotContainValue, doesNotHave, doesNotHaveSameClassAs, extracting, extracting, extractingByKey, extractingByKey, extractingByKeys, extractingByKeysForProxy, extractingFromEntries, extractingFromEntries, extractingFromEntriesForProxy, flatExtracting, has, hasEntrySatisfying, hasEntrySatisfying, hasEntrySatisfying, hasEntrySatisfying, hasKeySatisfying, hasSameClassAs, hasSameSizeAs, hasSameSizeAs, hasSameSizeAs, hasSize, hasSizeBetween, hasSizeGreaterThan, hasSizeGreaterThanOrEqualTo, hasSizeLessThan, hasSizeLessThanOrEqualTo, hasToString, hasValueSatisfying, is, isEmpty, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEmpty, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNullOrEmpty, isOfAnyClassIn, isSameAs, isUnmodifiable, noneSatisfy, overridingErrorMessage, size, usingComparator, usingComparator, usingDefaultComparator, usingDefaultElementComparator, usingElementComparator, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, values, withFailMessage, withThreadDumpOnError`

### Methods inherited from class org.assertj.core.api.AbstractObjectAssert

`doesNotReturn, extracting, extracting, extracting, extracting, extracting, extracting, extractingForProxy, getComparatorsByType, hasAllNullFieldsOrProperties, hasAllNullFieldsOrPropertiesExcept, hasFieldOrProperty, hasFieldOrPropertyWithValue, hasNoNullFieldsOrProperties, hasNoNullFieldsOrPropertiesExcept, hasOnlyFields, isEqualToComparingFieldByField, isEqualToComparingFieldByFieldRecursively, isEqualToComparingOnlyGivenFields, isEqualToIgnoringGivenFields, isEqualToIgnoringNullFields, newObjectAssert, returns, usingComparatorForFields, usingComparatorForType`

### Methods inherited from class org.assertj.core.api.AbstractAssert

`actual, areEqual, asInstanceOf, asList, assertionError, asString, descriptionText, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, hashCode, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, isElementOfCustomAssert, isInstanceOfSatisfying, isNull, matches, matches, newListAssertInstance, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingEquals, usingEquals, withFailMessage, withRepresentation`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.assertj.core.api.Descriptable

`as, describedAs`

## Constructor Details

### HttpHeadersAssert

public HttpHeadersAssert(org.springframework.http.HttpHeaders actual)

## Method Details

### containsHeader

public HttpHeadersAssert containsHeader(String name)
Verify that the actual HTTP headers contain a header with the given `name`.

Parameters:
  `name` - the name of an expected HTTP header
See Also:
  - `AbstractMapAssert.containsKey(K)`

### containsHeaders

public HttpHeadersAssert containsHeaders(String... names)
Verify that the actual HTTP headers contain the headers with the given `names`.

Parameters:
  `names` - the names of expected HTTP headers
See Also:
  - `AbstractMapAssert.containsKeys(K...)`

### doesNotContainHeader

public HttpHeadersAssert doesNotContainHeader(String name)
Verify that the actual HTTP headers do not contain a header with the given `name`.

Parameters:
  `name` - the name of an HTTP header that should not be present
See Also:
  - `AbstractMapAssert.doesNotContainKey(K)`

### doesNotContainHeaders

public HttpHeadersAssert doesNotContainHeaders(String... names)
Verify that the actual HTTP headers do not contain any of the headers with the given `names`.

Parameters:
  `names` - the names of HTTP headers that should not be present
Since:
  6.2.2
See Also:
  - `AbstractMapAssert.doesNotContainKeys(K...)`

### doesNotContainsHeaders

@Deprecated(since="6.2.2", forRemoval=true) public HttpHeadersAssert doesNotContainsHeaders(String... names)
Deprecated, for removal: This API element is subject to removal in a future version.
in favor of `doesNotContainHeaders(String...)`
Verify that the actual HTTP headers do not contain any of the headers with the given `names`.

Parameters:
  `names` - the names of HTTP headers that should not be present
See Also:
  - `AbstractMapAssert.doesNotContainKeys(K...)`

### hasValue

public HttpHeadersAssert hasValue(String name, String value)
Verify that the actual HTTP headers contain a header with the given `name` and `String` `value`.

Parameters:
  `name` - the name of the header
  `value` - the expected value of the header

### hasValue

public HttpHeadersAssert hasValue(String name, long value)
Verify that the actual HTTP headers contain a header with the given `name` and `long` `value`.

Parameters:
  `name` - the name of the header
  `value` - the expected value of the header

### hasValue

public HttpHeadersAssert hasValue(String name, Instant value)
Verify that the actual HTTP headers contain a header with the given `name` and `Instant` `value`.

Parameters:
  `name` - the name of the header
  `value` - the expected value of the header