use of android.content.rollback.RollbackInfo in project robolectric by robolectric.
the class RollbackInfoBuilderTest method build.
@Test
public void build() {
VersionedPackage packageRolledBackFrom = new VersionedPackage("test_package", 123);
VersionedPackage packageRolledBackTo = new VersionedPackage("test_package", 345);
PackageRollbackInfo packageRollbackInfo = PackageRollbackInfoBuilder.newBuilder().setPackageRolledBackFrom(packageRolledBackFrom).setPackageRolledBackTo(packageRolledBackTo).build();
RollbackInfo rollbackInfo = RollbackInfoBuilder.newBuilder().setRollbackId(1).setPackages(ImmutableList.of(packageRollbackInfo)).setIsStaged(true).setCausePackages(ImmutableList.of(packageRolledBackFrom)).setCommittedSessionId(10).build();
assertThat(rollbackInfo).isNotNull();
assertThat(rollbackInfo.getRollbackId()).isEqualTo(1);
assertThat(rollbackInfo.getPackages()).containsExactly(packageRollbackInfo);
assertThat(rollbackInfo.isStaged()).isTrue();
assertThat(rollbackInfo.getCausePackages()).containsExactly(packageRolledBackFrom);
assertThat(rollbackInfo.getCommittedSessionId()).isEqualTo(10);
}
use of android.content.rollback.RollbackInfo in project robolectric by robolectric.
the class RollbackInfoBuilderTest method build_withNoSetFields.
@Test
public void build_withNoSetFields() {
RollbackInfo rollbackInfo = RollbackInfoBuilder.newBuilder().build();
assertThat(rollbackInfo).isNotNull();
}
Aggregations