20
20
class DockerImageNameHelperTest {
21
21
22
22
@ ParameterizedTest
23
- @ CsvSource ({"hello:1,hello" , "hello/world:2,world" , "foo/bar/fizz/buzz:3,buzz" , "hello,hello" })
23
+ @ CsvSource ({"hello:1,hello" , "hello/world:2,world" , "foo/bar/fizz/buzz:3,buzz" , "hello,hello" , "registry.internal:1234/foo/bar:1,bar" })
24
24
void testExtractShortImageName (final String fullName , final String expected ) {
25
25
final var actual = DockerImageNameHelper .extractShortImageName (fullName );
26
26
Assertions .assertEquals (expected , actual );
27
27
}
28
28
29
29
@ ParameterizedTest
30
- @ CsvSource ({"hello:1,hello" , "hello/world:2,hello/world" , "foo/bar/fizz/buzz:3,foo/bar/fizz/buzz" , "hello,hello" , "hello:1.1-foo,hello" })
30
+ @ CsvSource ({"hello:1,hello" , "hello/world:2,hello/world" , "foo/bar/fizz/buzz:3,foo/bar/fizz/buzz" , "hello,hello" , "hello:1.1-foo,hello" ,
31
+ "registry.internal:1234/foo/bar:1,registry.internal:1234/foo/bar" })
31
32
void testExtractImageNameWithoutVersion (final String fullName , final String expected ) {
32
33
final var actual = DockerImageNameHelper .extractImageNameWithoutVersion (fullName );
33
34
Assertions .assertEquals (expected , actual );
34
35
}
35
36
36
37
@ ParameterizedTest
37
- @ CsvSource ({"hello:1,1" , "hello/world:2,2" , "foo/bar/fizz/buzz:3,3" , "hello," , "hello:1.1-foo,1.1-foo" })
38
+ @ CsvSource ({"hello:1,1" , "hello/world:2,2" , "foo/bar/fizz/buzz:3,3" , "hello," , "hello:1.1-foo,1.1-foo" , "registry.internal:1234/foo/bar:1,1" })
38
39
void testExtractImageVersionString (final String fullName , final String expected ) {
39
40
final var actual = DockerImageNameHelper .extractImageVersionString (fullName );
40
41
Assertions .assertEquals (expected , actual );
@@ -49,7 +50,8 @@ public Stream<? extends Arguments> provideArguments(final ExtensionContext conte
49
50
Arguments .of ("hello:1" , null ),
50
51
Arguments .of ("hello:dev" , new Version ("dev" )),
51
52
Arguments .of ("hello" , null ),
52
- Arguments .of ("hello/foo/bar:1.2.3" , new Version ("1.2.3" )));
53
+ Arguments .of ("hello/foo/bar:1.2.3" , new Version ("1.2.3" )),
54
+ Arguments .of ("registry.internal:1234/foo/bar:1.0.0" , new Version ("1.0.0" )));
53
55
}
54
56
55
57
}
0 commit comments