<commit_before>package se.crisp.codekvast.testsupport.docker;

import org.junit.Test;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

/**
 * @author <EMAIL>
 */
public class DockerContainerTest {

    @Test
    public void should_build_run_command_multiple_ports_multiple_envs() {
        DockerContainer dc = DockerContainer.builder()
                                            .imageName("imageName")
                                            .port("1:1")
                                            .port("2:2")
                                            .env("E1=E1")
                                            .env("E2=E2")
                                            .build();
        assertThat(dc.buildDockerRunCommand(), is("docker run -d -p 1:1 -p 2:2 -e E1=E1 -e E2=E2 imageName"));
    }

    @Test
    public void should_build_run_command_only_image() {
        DockerContainer dc = DockerContainer.builder()
                                            .imageName("imageName")
                                            .build();
        assertThat(dc.buildDockerRunCommand(), is("docker run -d imageName"));
    }
}<commit_msg>Added support for DockerContainer args<commit_after>package se.crisp.codekvast.testsupport.docker;

import org.junit.Test;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

/**
 * @author <EMAIL>
 */
public class DockerContainerTest {

    @Test
    public void should_build_run_command_multiple_ports_multiple_envs() {
        DockerContainer dc = DockerContainer.builder()
                                            .imageName("imageName")
                                            .port("1:1")
                                            .port("2:2")
                                            .env("E1=E1")
                                            .env("E2=E2")
                                            .build();
        assertThat(dc.buildDockerRunCommand(), is("docker run -d -p 1:1 -p 2:2 -e E1=E1 -e E2=E2 imageName"));
    }

    @Test
    public void should_build_run_command_only_image() {
        DockerContainer dc = DockerContainer.builder()
                                            .imageName("imageName")
                                            .build();
        assertThat(dc.buildDockerRunCommand(), is("docker run -d imageName"));
    }

    @Test
    public void should_build_run_command_image_and_args() {
        DockerContainer dc = DockerContainer.builder()
                                            .imageName("imageName")
                                            .args("arg1 arg2")
                                            .build();
        assertThat(dc.buildDockerRunCommand(), is("docker run -d imageName arg1 arg2"));
    }
}
{'fraction_non_alphanumeric': 0.10046478369681802, 'fraction_numerical': 0.012870933142652842, 'mean_word_length': 1.29532403609516, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 38, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2282954', 'n_tokens_mistral': 686, 'n_tokens_neox': 665, 'n_words': 132}