org.assertj.android.api.util.AtomicFileAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of assertj-android Show documentation
Show all versions of assertj-android Show documentation
A set of AssertJ assertion helpers geared toward testing Android.
package org.assertj.android.api.util;
import android.annotation.TargetApi;
import android.util.AtomicFile;
import java.io.File;
import org.assertj.core.api.AbstractAssert;
import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1;
import static org.assertj.core.api.Assertions.assertThat;
@TargetApi(JELLY_BEAN_MR1)
public class AtomicFileAssert extends AbstractAssert {
public AtomicFileAssert(AtomicFile actual) {
super(actual, AtomicFileAssert.class);
}
public AtomicFileAssert hasBaseFile(File file) {
isNotNull();
File actualFile = actual.getBaseFile();
assertThat(actualFile) //
.overridingErrorMessage("Expected base file <%s> but was <%s>.", file, actualFile) //
.isEqualTo(file);
return this;
}
}