diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2024-01-05 08:05:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-05 08:05:47 +0100 |
commit | d02469096d4bf5b0bc742e5ec978f9f8cc873eda (patch) | |
tree | de5613532bfd2ed52586d3072d6b0b891a91d66f /config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/ConfigValueChangeValidatorTest.java | |
parent | d8b50e4eaea708fed984c7c6ccdd06ac48b358bf (diff) |
Revert "Revert "Jonmv/refactor validation" MERGEOK"
Diffstat (limited to 'config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/ConfigValueChangeValidatorTest.java')
-rw-r--r-- | config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/ConfigValueChangeValidatorTest.java | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/ConfigValueChangeValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/ConfigValueChangeValidatorTest.java index a41b538d3ca..f68a1da7dfb 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/ConfigValueChangeValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/ConfigValueChangeValidatorTest.java @@ -1,16 +1,15 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.application.validation.change; -import com.yahoo.config.model.deploy.DeployState; -import com.yahoo.test.AnotherrestartConfig; import com.yahoo.config.ConfigInstance; -import com.yahoo.test.RestartConfig; -import com.yahoo.test.SimpletypesConfig; import com.yahoo.config.model.api.ConfigChangeAction; +import com.yahoo.config.model.producer.AbstractConfigProducerRoot; import com.yahoo.config.model.producer.AnyConfigProducer; import com.yahoo.config.model.producer.TreeConfigProducer; -import com.yahoo.config.model.producer.AbstractConfigProducerRoot; import com.yahoo.config.model.test.MockRoot; +import com.yahoo.test.AnotherrestartConfig; +import com.yahoo.test.RestartConfig; +import com.yahoo.test.SimpletypesConfig; import com.yahoo.vespa.model.AbstractService; import com.yahoo.vespa.model.Host; import com.yahoo.vespa.model.HostResource; @@ -25,7 +24,9 @@ import org.junit.jupiter.api.Test; import java.util.List; import java.util.stream.Collectors; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Testing the validator on both a stub model and a real-life Vespa model. @@ -152,11 +153,6 @@ public class ConfigValueChangeValidatorTest { assertEmptyLog(); } - private List<ConfigChangeAction> getConfigChanges(VespaModel currentModel, VespaModel nextModel) { - ConfigValueChangeValidator validator = new ConfigValueChangeValidator(); - return validator.validate(currentModel, nextModel, new DeployState.Builder().deployLogger(logger).build()); - } - private List<ConfigChangeAction> getConfigChanges(AbstractConfigProducerRoot currentModel, AbstractConfigProducerRoot nextModel) { ConfigValueChangeValidator validator = new ConfigValueChangeValidator(); @@ -245,8 +241,7 @@ public class ConfigValueChangeValidatorTest { setHostResource(new HostResource(new Host(null, "localhost"))); } - @Override - public int getPortCount() { + @Override public int getPortCount() { return 0; } @@ -262,8 +257,7 @@ public class ConfigValueChangeValidatorTest { this.value = value; } - @Override - public void getConfig(RestartConfig.Builder builder) { + @Override public void getConfig(RestartConfig.Builder builder) { builder.value(value); } @@ -283,8 +277,7 @@ public class ConfigValueChangeValidatorTest { this.anotherValue = anotherValue; } - @Override - public void getConfig(AnotherrestartConfig.Builder builder) { + @Override public void getConfig(AnotherrestartConfig.Builder builder) { builder.anothervalue(anotherValue); } } |