aboutsummaryrefslogtreecommitdiffstats
path: root/config-provisioning/src/test/java/com/yahoo/config/provision/DockerImageTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'config-provisioning/src/test/java/com/yahoo/config/provision/DockerImageTest.java')
-rw-r--r--config-provisioning/src/test/java/com/yahoo/config/provision/DockerImageTest.java42
1 files changed, 21 insertions, 21 deletions
diff --git a/config-provisioning/src/test/java/com/yahoo/config/provision/DockerImageTest.java b/config-provisioning/src/test/java/com/yahoo/config/provision/DockerImageTest.java
index 2e0de192f03..36cc83f91b6 100644
--- a/config-provisioning/src/test/java/com/yahoo/config/provision/DockerImageTest.java
+++ b/config-provisioning/src/test/java/com/yahoo/config/provision/DockerImageTest.java
@@ -1,15 +1,15 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.provision;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.util.List;
import java.util.Map;
import java.util.Optional;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.fail;
/**
* @author mpolden
@@ -17,42 +17,42 @@ import static org.junit.Assert.fail;
public class DockerImageTest {
@Test
- public void parse() {
+ void parse() {
Map<String, DockerImage> tests = Map.of(
- "", DockerImage.EMPTY,
- "registry.example.com:9999/vespa/vespa:7.42", new DockerImage("registry.example.com:9999", "vespa/vespa", Optional.of("7.42")),
- "registry.example.com/vespa/vespa:7.42", new DockerImage("registry.example.com", "vespa/vespa", Optional.of("7.42")),
- "registry.example.com:9999/vespa/vespa", new DockerImage("registry.example.com:9999", "vespa/vespa", Optional.empty()),
- "registry.example.com/vespa/vespa", new DockerImage("registry.example.com", "vespa/vespa", Optional.empty()),
- "registry.example.com/project/repo/vespa/vespa", new DockerImage("registry.example.com/project/repo", "vespa/vespa", Optional.empty())
+ "", DockerImage.EMPTY,
+ "registry.example.com:9999/vespa/vespa:7.42", new DockerImage("registry.example.com:9999", "vespa/vespa", Optional.of("7.42")),
+ "registry.example.com/vespa/vespa:7.42", new DockerImage("registry.example.com", "vespa/vespa", Optional.of("7.42")),
+ "registry.example.com:9999/vespa/vespa", new DockerImage("registry.example.com:9999", "vespa/vespa", Optional.empty()),
+ "registry.example.com/vespa/vespa", new DockerImage("registry.example.com", "vespa/vespa", Optional.empty()),
+ "registry.example.com/project/repo/vespa/vespa", new DockerImage("registry.example.com/project/repo", "vespa/vespa", Optional.empty())
);
tests.forEach((value, expected) -> {
DockerImage parsed = DockerImage.fromString(value);
assertEquals(value, parsed.asString());
String untagged = expected.equals(DockerImage.EMPTY)
- ? ""
- : expected.registry() + "/" + expected.repository();
+ ? ""
+ : expected.registry() + "/" + expected.repository();
assertEquals(untagged, parsed.untagged());
});
}
@Test
- public void registry_cannot_contain_slash() {
+ void registry_cannot_contain_slash() {
DockerImage image = DockerImage.fromString("registry.example.com/vespa/vespa");
assertThrows(IllegalArgumentException.class, () -> image.withRegistry(""));
assertThrows(IllegalArgumentException.class, () -> image.withRegistry("my-registry/path/"));
}
@Test
- public void parse_invalid() {
+ void parse_invalid() {
List<String> tests = List.of(
- "registry.example.com",
- "registry.example.com/",
- "registry.example.com/repository",
- "registry.example.com/repository:",
- "foo",
- "foo:1.2.3"
+ "registry.example.com",
+ "registry.example.com/",
+ "registry.example.com/repository",
+ "registry.example.com/repository:",
+ "foo",
+ "foo:1.2.3"
);
for (var value : tests) {
try {