public final class SortedMapSubject extends MapSubject
SortedMap
and NavigableMap
objects. This class supports assertions
based on NavigableMap
's API even if the subject only implements SortedMap
.MapSubject.UsingCorrespondence<A,E>
failureStrategy
Modifier and Type | Method and Description |
---|---|
void |
hasFirstEntry(Object key,
Object value)
Fails if the map's first key/value pair is not equal to the given entry.
|
void |
hasFirstKey(Object key)
Fails if the map's first key is not equal to the given key.
|
void |
hasLastEntry(Object key,
Object value)
Fails if the map's last key/value pair is not equal to the given entry.
|
void |
hasLastKey(Object key)
Fails if the map's last key is not equal to the given key.
|
SortedMapSubject |
named(String format,
Object... args)
Adds a prefix to the subject, when it is displayed in error messages.
|
comparingValuesUsing, containsEntry, containsExactly, containsExactly, containsExactlyEntriesIn, containsKey, doesNotContainEntry, doesNotContainKey, hasSize, isEmpty, isEqualTo, isNotEmpty
actual, actualAsString, actualCustomStringRepresentation, check, equals, fail, fail, fail, failComparing, failComparing, failWithBadResults, failWithCustomSubject, failWithoutActual, failWithoutSubject, failWithRawMessage, failWithRawMessageAndCause, getDisplaySubject, getSubject, hashCode, ignoreCheck, internalCustomName, isAnyOf, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs
public SortedMapSubject named(String format, Object... args)
Subject
toString()
representation, e.g. boolean.
Writing assertThat(foo).named("foo").isTrue();
then results in a more reasonable error
message.
named()
takes a format template and argument objects which will be substituted into
the template, similar to String.format(String, Object...)
, the chief difference being
that extra parameters (for which there are no template variables) will be appended to the
resulting string in brackets. Additionally, this only supports the %s
template variable
type.
named
in class Subject<MapSubject,Map<?,?>>
public void hasFirstKey(@Nullable Object key)
public void hasFirstEntry(@Nullable Object key, @Nullable Object value)
public void hasLastKey(@Nullable Object key)
Copyright © 2017. All rights reserved.