summaryrefslogtreecommitdiffstats
path: root/configserver/src/test
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2017-04-07 16:49:04 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2017-04-07 16:49:04 +0200
commit025167b28f847e56333db4922d7a7543fcad7a1a (patch)
treea2466cbccc5fcffa89eb23464a915c83b83ef051 /configserver/src/test
parentb2f526a6b79965b9ff871d8cdfe283dccc1eefe8 (diff)
Pass wanted node Vespa version around
Diffstat (limited to 'configserver/src/test')
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/ModelContextImplTest.java4
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java6
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/session/PrepareParamsTest.java14
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionPreparerTest.java2
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClientTest.java4
5 files changed, 15 insertions, 15 deletions
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/ModelContextImplTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/ModelContextImplTest.java
index 0352f2c9f3e..74f030919ec 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/ModelContextImplTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/ModelContextImplTest.java
@@ -1,6 +1,7 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server;
+import com.yahoo.component.Version;
import com.yahoo.config.model.api.ModelContext;
import com.yahoo.config.model.application.provider.BaseDeployLogger;
import com.yahoo.config.model.application.provider.MockFileRegistry;
@@ -48,7 +49,8 @@ public class ModelContextImplTest {
Zone.defaultZone(),
rotations),
Optional.empty(),
- Optional.empty());
+ new Version(6),
+ new Version(6));
assertTrue(context.applicationPackage() instanceof MockApplicationPackage);
assertFalse(context.hostProvisioner().isPresent());
assertFalse(context.permanentApplicationPackage().isPresent());
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 07fb3cd51c7..8e20f190c5b 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
@@ -115,14 +115,14 @@ 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, Optional<String> dockerVespaImageVersion) {
+ public ApplicationId deployApp(String appName, Optional<String> vespaVersion) {
final Tenant tenant = tenant();
LocalSession session = tenant.getSessionFactory().createSession(testApp, appName, new TimeoutBudget(Clock.systemUTC(), Duration.ofSeconds(60)));
ApplicationId id = ApplicationId.from(tenant.getName(), ApplicationName.from(appName), InstanceName.defaultName());
PrepareParams.Builder paramsBuilder = new PrepareParams.Builder()
.applicationId(id);
- if (dockerVespaImageVersion.isPresent())
- paramsBuilder.dockerVespaImageVersion(dockerVespaImageVersion.get());
+ if (vespaVersion.isPresent())
+ paramsBuilder.vespaVersion(vespaVersion.get());
session.prepare(new SilentDeployLogger(),
paramsBuilder.build(),
Optional.empty(),
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/session/PrepareParamsTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/session/PrepareParamsTest.java
index d91fff41f2e..b8ea8b5a4f9 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/session/PrepareParamsTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/session/PrepareParamsTest.java
@@ -34,9 +34,9 @@ public class PrepareParamsTest {
assertThat(prepareParams.getApplicationId(), is(ApplicationId.defaultId()));
assertFalse(prepareParams.isDryRun());
assertFalse(prepareParams.ignoreValidationErrors());
- assertThat(prepareParams.getVespaVersion(), is(Optional.<String>empty()));
+ assertThat(prepareParams.vespaVersion(), is(Optional.<String>empty()));
assertTrue(prepareParams.getTimeoutBudget().hasTimeLeft());
- assertThat(prepareParams.getRotations().size(), is(0));
+ assertThat(prepareParams.rotations().size(), is(0));
}
@@ -46,8 +46,7 @@ public class PrepareParamsTest {
PrepareParams.DRY_RUN_PARAM_NAME + "=true&" +
PrepareParams.IGNORE_VALIDATION_PARAM_NAME + "=false&" +
PrepareParams.APPLICATION_NAME_PARAM_NAME + "=baz&" +
- PrepareParams.VESPA_VERSION_PARAM_NAME + "=" + vespaVersion + "&" +
- PrepareParams.DOCKER_VESPA_IMAGE_VERSION_PARAM_NAME+ "=" + vespaVersion;
+ PrepareParams.VESPA_VERSION_PARAM_NAME + "=" + vespaVersion;
@Test
public void testCorrectParsingWithRotation() {
@@ -59,12 +58,11 @@ public class PrepareParamsTest {
assertTrue(prepareParams.isDryRun());
assertFalse(prepareParams.ignoreValidationErrors());
final Version expectedVersion = Version.fromString(vespaVersion);
- assertThat(prepareParams.getVespaVersion().get(), is(expectedVersion));
+ assertThat(prepareParams.vespaVersion().get(), is(expectedVersion));
assertTrue(prepareParams.getTimeoutBudget().hasTimeLeft());
- final Set<Rotation> rotations = prepareParams.getRotations();
+ final Set<Rotation> rotations = prepareParams.rotations();
assertThat(rotations.size(), is(1));
assertThat(rotations, contains(equalTo(new Rotation(rotation))));
- assertThat(prepareParams.getDockerVespaImageVersion().get(), is(expectedVersion));
}
@Test
@@ -74,7 +72,7 @@ public class PrepareParamsTest {
PrepareParams prepareParams = createParams(request + "&" +
PrepareParams.ROTATIONS_PARAM_NAME + "=" + twoRotations,
TenantName.from("foo"));
- final Set<Rotation> rotations = prepareParams.getRotations();
+ final Set<Rotation> rotations = prepareParams.rotations();
assertThat(rotations, containsInAnyOrder(new Rotation(rotation), new Rotation(rotationTwo)));
}
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionPreparerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionPreparerTest.java
index ac25cba3b47..1e61e6e9e08 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionPreparerTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionPreparerTest.java
@@ -186,7 +186,7 @@ public class SessionPreparerTest extends TestWithCurator {
preparer.prepare(getContext(getApplicationPackage(testApp)), getLogger(), params, Optional.empty(), tenantPath);
SessionZooKeeperClient zkc = new SessionZooKeeperClient(curator, appPath);
assertTrue(configCurator.exists(appPath.append(SessionZooKeeperClient.APPLICATION_ID_PATH).getAbsolute()));
- assertThat(zkc.readApplicationId(tenant), is(origId));
+ assertThat(zkc.readApplicationId(), is(origId));
}
@Test
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClientTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClientTest.java
index 4508d8c234f..d4f3665ac6f 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClientTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClientTest.java
@@ -76,7 +76,7 @@ public class SessionZooKeeperClientTest extends TestWithCurator {
@Test
public void require_that_default_name_is_returned_if_node_does_not_exist() {
- assertThat(createSessionZKClient("3").readApplicationId(TenantName.defaultName()).application().value(), is("default"));
+ assertThat(createSessionZKClient("3").readApplicationId().application().value(), is("default"));
}
@Test
@@ -101,7 +101,7 @@ public class SessionZooKeeperClientTest extends TestWithCurator {
SessionZooKeeperClient zkc = createSessionZKClient(sessionId);
String path = "/" + sessionId + "/" + SessionZooKeeperClient.APPLICATION_ID_PATH;
configCurator.putData(path, idString);
- ApplicationId zkId = zkc.readApplicationId(TenantName.defaultName());
+ ApplicationId zkId = zkc.readApplicationId();
assertThat(zkId.serializedForm(), is(expectedIdString));
}