Class MapSubject<S extends MapSubject<S,K,V,M>,K,V,M extends Map<K,V>>

java.lang.Object
com.google.common.truth.Subject<S,M>
com.google.common.truth.MapSubject<S,K,V,M>

public class MapSubject<S extends MapSubject<S,K,V,M>,K,V,M extends Map<K,V>> extends Subject<S,M>
Propositions for Map subjects.
  • Constructor Details

  • Method Details

    • create

      static <K, V, M extends Map<K, V>> MapSubject<? extends MapSubject<?,K,V,M>,K,V,M> create(FailureStrategy failureStrategy, Map<K,V> map)
    • isEmpty

      public void isEmpty()
      Fails if the map is not empty.
    • isNotEmpty

      public void isNotEmpty()
      Fails if the map is empty.
    • hasSize

      public final void hasSize(int expectedSize)
      Fails if the map does not have the given size.
    • containsKey

      public void containsKey(Object key)
      Fails if the map does not contain the given key.
    • doesNotContainKey

      public void doesNotContainKey(Object key)
      Fails if the map contains the given key.
    • containsEntry

      public void containsEntry(Object key, Object value)
      Fails if the map does not contain the given entry.
    • doesNotContainEntry

      public void doesNotContainEntry(Object key, Object value)
      Fails if the map contains the given entry.
    • hasKey

      @Deprecated public MapSubject.WithValue<V> hasKey(K key)
      Deprecated.
      Use containsKey(Object) instead.
      Fails if the map does not contain the given key.
    • lacksKey

      @Deprecated public void lacksKey(K key)
      Deprecated.
      Fails if the map contains the given key.