BundleSubject


public final class BundleSubject extends Subject


Subject for making assertions about Bundles.

To assert about android.os.PersistableBundles, use PersistableBundleSubject.

Summary

Public methods

static BundleSubject
BooleanSubject
bool(String key)
static Subject.Factory<BundleSubjectBundle>
PrimitiveByteArraySubject
void
void
@NonNull DoubleSubject
void
hasSize(int size)
IntegerSubject
void
void
LongSubject
ParcelableSubject<T>
<T extends Parcelable> parcelable(String key)
IterableSubject
SubjectT
<T extends Parcelable, SubjectT extends Subject> parcelableAsType(
    String key,
    Subject.Factory<SubjectT, T> subjectFactory
)
Subject

Returns a truth subject for the value associated with the given key.

StringSubject
@NonNull ObjectArraySubject<String>
IterableSubject

Inherited methods

From com.google.common.truth.Subject
String
final boolean

This method is deprecated.

final void
final void
failWithoutActual(Fact first, Fact[] rest)
final int

This method is deprecated.

final StandardSubjectBuilder
void
isAnyOf(Object first, Object second, @Nullable Object[] rest)
void
isEqualTo(Object expected)
void
void
void
isNoneOf(Object first, Object second, @Nullable Object[] rest)
void
isNotEqualTo(Object unexpected)
void
void
void
final void
void
final void
String

This method is deprecated.

Public methods

assertThat

public static BundleSubject assertThat(Bundle bundle)

bool

public BooleanSubject bool(String key)

bundles

public static Subject.Factory<BundleSubjectBundlebundles()

byteArray

public PrimitiveByteArraySubject byteArray(String key)

containsKey

public void containsKey(String key)

doesNotContainKey

public void doesNotContainKey(String key)

doubleFloat

public @NonNull DoubleSubject doubleFloat(@NonNull String key)

hasSize

public void hasSize(int size)

integer

public IntegerSubject integer(String key)

isEmpty

public void isEmpty()

isNotEmpty

public void isNotEmpty()

longInt

public LongSubject longInt(String key)

parcelable

public ParcelableSubject<T> <T extends Parcelable> parcelable(String key)

parcelableArrayList

public IterableSubject parcelableArrayList(String key)

parcelableAsType

public SubjectT <T extends Parcelable, SubjectT extends Subject> parcelableAsType(
    String key,
    Subject.Factory<SubjectT, T> subjectFactory
)

serializable

public Subject serializable(String key)

Returns a truth subject for the value associated with the given key.

string

public StringSubject string(String key)

stringArray

public @NonNull ObjectArraySubject<StringstringArray(@NonNull String key)

stringArrayList

public IterableSubject stringArrayList(String key)