Add a resubmit helper, fix salt and some other minor tests code bugs
@@ -254,6 +254,11 @@ public class DeploymentContext {
return this;
}
+ /** Submit given application package for deployment */
+ public DeploymentContext resubmit(ApplicationPackage applicationPackage) {
+ return submit(applicationPackage, Optional.of(defaultSourceRevision), salt.get());
+ }
+
/** Submit given application package for deployment */
public DeploymentContext submit(ApplicationPackage applicationPackage) {
return submit(applicationPackage, Optional.of(defaultSourceRevision));
@@ -266,7 +271,7 @@ public class DeploymentContext {
/** Submit given application package for deployment */
public DeploymentContext submit(ApplicationPackage applicationPackage, Optional<SourceRevision> sourceRevision) {
- return submit(applicationPackage, sourceRevision, salt.getAndIncrement());
+ return submit(applicationPackage, sourceRevision, salt.incrementAndGet());
}
/** Submit given application package for deployment */
@@ -597,8 +602,9 @@ public class DeploymentContext {
runner.advance(currentRun(job));
assertTrue(jobs.run(id).get().hasEnded());
assertFalse(jobs.run(id).get().hasFailed());
- assertEquals(job.type().isProduction(), instance().deployments().containsKey(zone));
- assertTrue(configServer().nodeRepository().list(zone, NodeFilter.all().applications(TesterId.of(id.application()).id())).isEmpty());
+ Instance instance = tester.application(TenantAndApplicationId.from(instanceId)).require(id.application().instance());
+ assertEquals(job.type().isProduction(), instance.deployments().containsKey(zone));
+ assertTrue(configServer().nodeRepository().list(zone, NodeFilter.all().applications(TesterId.of(instance.id()).id())).isEmpty());
}
private JobId jobId(JobType type) {
