Class MapSubject
java.lang.Object
com.qaitsolutions.pframe.core.assertion.subjects.Subject
com.qaitsolutions.pframe.core.assertion.subjects.MapSubject
Wrapper over
MapSubject
- Since:
- 1.0
- Author:
- Iulian Andrei (iulian.andrei@qaitsolutions.com)
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionMapSubject
(Map<?, ?> actual, String message) Constructor for regular assertions.MapSubject
(Map<?, ?> actual, String message, ErrorTracker tracker) Constructor for soft assertions. -
Method Summary
Modifier and TypeMethodDescriptionvoid
containsAtLeast
(Object k0, Object v0, Object... rest) Fails if the map does not contain at least the given set of entries in the given map.void
containsAtLeastEntriesIn
(Map<?, ?> expectedMap) Fails if the map does not contain at least the given set of entries in the given map.void
containsEntry
(Object key, Object value) Fails if the map does not contain the given entry.void
containsExactly
(Object k0, Object v0, Object... rest) Fails if the map does not contain exactly the given set of key/value pairs.void
containsExactlyEntriesIn
(Map<?, ?> expectedMap) Fails if the map does not contain exactly the given set of entries in the given map.void
containsKey
(Object key) Fails if the map does not contain the given key.void
doesNotContainEntry
(Object key, Object value) Fails if the map contains the given entry.void
doesNotContainKey
(Object key) Fails if the map contains the given key.void
hasSize
(int expectedSize) Fails if the map does not have the given size.void
isEmpty()
Fails if the map is not empty.void
Fails if the subject is not equal to the given object.void
Fails if the map is empty.Methods inherited from class com.qaitsolutions.pframe.core.assertion.subjects.Subject
isAnyOf, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameInstanceAs, isNull, isSameInstanceAs
-
Constructor Details
-
MapSubject
Constructor for regular assertions.- Parameters:
actual
- Current value to be verified.message
- Description of the assertion.
-
MapSubject
Constructor for soft assertions.- Parameters:
actual
- Current value to be verified.message
- Description of the assertion.tracker
- Entity which allows keeping track of existing errors.
-
-
Method Details
-
isEqualTo
Description copied from class:Subject
Fails if the subject is not equal to the given object. Wrapper overSubject.isEqualTo(Object)
. -
isEmpty
public void isEmpty()Fails if the map is not empty. Wrapper overMapSubject.isEmpty()
. -
isNotEmpty
public void isNotEmpty()Fails if the map is empty. Wrapper overMapSubject.isNotEmpty()
. -
hasSize
public void hasSize(int expectedSize) Fails if the map does not have the given size. Wrapper overMapSubject.hasSize(int)
.- Parameters:
expectedSize
- Value to be verified against.
-
containsKey
Fails if the map does not contain the given key. Wrapper overMapSubject.containsKey(Object)
.- Parameters:
key
- Value to be verified against.
-
doesNotContainKey
Fails if the map contains the given key. Wrapper overMapSubject.doesNotContainKey(Object)
.- Parameters:
key
- Value to be verified against.
-
containsEntry
Fails if the map does not contain the given entry. Wrapper overMapSubject.containsEntry(Object, Object)
.- Parameters:
key
- Value to be verified against.value
- Value to be verified against.
-
doesNotContainEntry
Fails if the map contains the given entry. Wrapper overMapSubject.doesNotContainEntry(Object, Object)
.- Parameters:
key
- Value to be verified against.value
- Value to be verified against.
-
containsExactly
Fails if the map does not contain exactly the given set of key/value pairs. Wrapper overMapSubject.containsExactly(Object, Object, Object...)
.- Parameters:
k0
- Value to be verified against.v0
- Value to be verified against.rest
- Value to be verified against.
-
containsAtLeast
Fails if the map does not contain at least the given set of entries in the given map. Wrapper overMapSubject.containsAtLeast(Object, Object, Object...)
.- Parameters:
k0
- Value to be verified against.v0
- Value to be verified against.rest
- Value to be verified against.
-
containsExactlyEntriesIn
Fails if the map does not contain exactly the given set of entries in the given map. Wrapper overMapSubject.containsExactlyEntriesIn(Map)
.- Parameters:
expectedMap
- Value to be verified against.
-
containsAtLeastEntriesIn
Fails if the map does not contain at least the given set of entries in the given map. Wrapper overMapSubject.containsAtLeastEntriesIn(Map)
.- Parameters:
expectedMap
- Value to be verified against.
-