diff options
author | jonmv <venstad@gmail.com> | 2022-06-09 21:33:45 +0200 |
---|---|---|
committer | jonmv <venstad@gmail.com> | 2022-06-09 21:33:45 +0200 |
commit | e65631e735b6cf2a40d1d41cb86d9155cde57692 (patch) | |
tree | 1d261037001acc0d3ee711fff1248b1c17affbe5 /configserver/src/test | |
parent | 2d620a6bbd1f6f58f969f6d7af04cad20a20fe37 (diff) |
Deploy with target on same major as in deployment.xml in tests (and remove impossible scenario)
Diffstat (limited to 'configserver/src/test')
-rw-r--r-- | configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionRepositoryTest.java | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionRepositoryTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionRepositoryTest.java index b380436e028..28a125acbd5 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionRepositoryTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionRepositoryTest.java @@ -240,31 +240,13 @@ public class SessionRepositoryTest { failingFactory.throwErrorOnLoad = true; MockModelFactory okFactory = new MockModelFactory(); - okFactory.vespaVersion = new Version(2, 0, 0); - okFactory.throwErrorOnLoad = false; - - setup(new ModelFactoryRegistry(List.of(okFactory, failingFactory))); - - File testApp = new File("src/test/apps/app-major-version-7"); - deploy(applicationId, testApp); - - // Does not cause an error because model version 8 is skipped - } - - @Test - public void require_that_an_application_package_can_limit_to_one_higher_major_version() throws Exception { - MockModelFactory failingFactory = new MockModelFactory(); - failingFactory.vespaVersion = new Version(8, 0, 0); - failingFactory.throwErrorOnLoad = true; - - MockModelFactory okFactory = new MockModelFactory(); - okFactory.vespaVersion = new Version(6, 0, 0); + okFactory.vespaVersion = new Version(7, 0, 0); okFactory.throwErrorOnLoad = false; setup(new ModelFactoryRegistry(List.of(okFactory, failingFactory))); File testApp = new File("src/test/apps/app-major-version-7"); - deploy(applicationId, testApp); + deploy(new PrepareParams.Builder().applicationId(applicationId).vespaVersion(okFactory.vespaVersion).build(), testApp); // Does not cause an error because model version 8 is skipped } @@ -341,7 +323,11 @@ public class SessionRepositoryTest { } private long deploy(ApplicationId applicationId, File testApp) { - applicationRepository.deploy(testApp, new PrepareParams.Builder().applicationId(applicationId).build()); + return deploy(new PrepareParams.Builder().applicationId(applicationId).build(), testApp); + } + + private long deploy(PrepareParams params, File testApp) { + applicationRepository.deploy(testApp, params); return applicationRepository.getActiveSession(applicationId).get().getSessionId(); } |