<commit_before>package org.testcontainers.utility;

import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.rnorth.visibleassertions.VisibleAssertions;

import static org.rnorth.visibleassertions.VisibleAssertions.assertEquals;

@RunWith(Enclosed.class)
public class DockerImageNameTest {

    @RunWith(Parameterized.class)
    public static class ValidNames {

        @Parameterized.Parameters(name = "{0}")
        public static String[] getNames() {
            return new String[]{"myname:latest",
                "myname:latest",
                "repo/my-name:1.0",
                "registry.foo.com:1234/my-name:1.0",
                "registry.foo.com/my-name:1.0",
                "registry.foo.com:1234/repo_here/my-name:1.0",
                "registry.foo.com:1234/repo-here/my-name@sha256:1234abcd1234abcd1234abcd1234abcd",
                "registry.foo.com:1234/my-name@sha256:1234abcd1234abcd1234abcd1234abcd",
                "1.2.3.4/my-name:1.0",
                "1.2.3.4:1234/my-name:1.0",
                "1.2.3.4/repo-here/my-name:1.0",
                "1.2.3.4:1234/repo-here/my-name:1.0"};
        }

        @Parameterized.Parameter
        public String imageName;

        @Test
        public void testValidNameAccepted() {
            new DockerImageName(imageName).assertValid();
        }
    }

    @RunWith(Parameterized.class)
    public static class InvalidNames {

        @Parameterized.Parameters(name = "{0}")
        public static String[] getNames() {
            return new String[]{":latest",<commit_msg>Remove duplicated DockerImageNameTest test case (#2040)<commit_after>package org.testcontainers.utility;

import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.rnorth.visibleassertions.VisibleAssertions;

import static org.rnorth.visibleassertions.VisibleAssertions.assertEquals;

@RunWith(Enclosed.class)
public class DockerImageNameTest {

    @RunWith(Parameterized.class)
    public static class ValidNames {

        @Parameterized.Parameters(name = "{0}")
        public static String[] getNames() {
            return new String[]{
                "myname:latest",
                "repo/my-name:1.0",
                "registry.foo.com:1234/my-name:1.0",
                "registry.foo.com/my-name:1.0",
                "registry.foo.com:1234/repo_here/my-name:1.0",
                "registry.foo.com:1234/repo-here/my-name@sha256:1234abcd1234abcd1234abcd1234abcd",
                "registry.foo.com:1234/my-name@sha256:1234abcd1234abcd1234abcd1234abcd",
                "1.2.3.4/my-name:1.0",
                "1.2.3.4:1234/my-name:1.0",
                "1.2.3.4/repo-here/my-name:1.0",
                "1.2.3.4:1234/repo-here/my-name:1.0"};
        }

        @Parameterized.Parameter
        public String imageName;

        @Test
        public void testValidNameAccepted() {
            new DockerImageName(imageName).assertValid();
        }
    }

    @RunWith(Parameterized.class)
    public static class InvalidNames {

        @Parameterized.Parameters(name = "{0}")
        public static String[] getNames() {
            return new String[]{":latest",
{'fraction_non_alphanumeric': 0.12892512077294685, 'fraction_numerical': 0.059178743961352656, 'mean_word_length': 2.4014373716632442, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4671209', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1025, 'n_words': 140}