diff options
author | Harald Musum <musum@oath.com> | 2018-01-30 14:02:52 +0100 |
---|---|---|
committer | Harald Musum <musum@oath.com> | 2018-01-30 14:02:52 +0100 |
commit | 2d0fe3a367315c820d41f5723b10b3089839d968 (patch) | |
tree | 526ebc2127668425ad2438e10eb0c8690c065b8f /configserver | |
parent | ee4d047e1a18cb0166d511ed0cad699b1accc8b7 (diff) |
Use application repo to avoid dealing with low-level code
Diffstat (limited to 'configserver')
-rw-r--r-- | configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java index 63f0f5f26b7..ac23861bd86 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java @@ -33,7 +33,6 @@ import com.yahoo.vespa.config.server.modelfactory.ModelFactoryRegistry; import com.yahoo.vespa.config.server.monitoring.Metrics; import com.yahoo.vespa.config.server.session.LocalSession; import com.yahoo.vespa.config.server.session.PrepareParams; -import com.yahoo.vespa.config.server.session.SilentDeployLogger; import com.yahoo.vespa.config.server.tenant.Tenant; import com.yahoo.vespa.config.server.tenant.Tenants; import com.yahoo.vespa.curator.Curator; @@ -134,20 +133,16 @@ public class DeployTester { * Do the initial "deploy" with the existing API-less code as the deploy API doesn't support first deploys yet. */ public ApplicationId deployApp(String appName, String vespaVersion, Instant now) { - Tenant tenant = tenant(); - LocalSession session = tenant.getSessionFactory().createSession(testApp, appName, new TimeoutBudget(clock, Duration.ofSeconds(60))); + TimeoutBudget timeoutBudget = new TimeoutBudget(clock, Duration.ofSeconds(60)); ApplicationId id = ApplicationId.from(tenant.getName(), ApplicationName.from(appName), InstanceName.defaultName()); PrepareParams.Builder paramsBuilder = new PrepareParams.Builder().applicationId(id); if (vespaVersion != null) paramsBuilder.vespaVersion(vespaVersion); - session.prepare(new SilentDeployLogger(), - paramsBuilder.build(), - Optional.empty(), - tenant.getPath(), - now); - session.createActivateTransaction().commit(); - tenant.getLocalSessionRepo().addSession(session); + + long sessionId = applicationRepository.createSession(tenant, timeoutBudget, testApp, appName); + applicationRepository.prepare(tenant, sessionId, paramsBuilder.build(), now); + applicationRepository.activate(tenant, sessionId, timeoutBudget, false, false); this.id = id; return id; } |