use of io.fabric8.maven.docker.config.CopyConfiguration.Builder in project docker-maven-plugin by fabric8io.
the class ContainerNamingUtilTest method imageConfiguration.
private ImageConfiguration imageConfiguration(String name, String alias, String containerNamePattern) {
ImageConfiguration.Builder builder = new ImageConfiguration.Builder().name(name).alias(alias);
if (containerNamePattern != null) {
RunImageConfiguration runConfig = new RunImageConfiguration.Builder().containerNamePattern(containerNamePattern).build();
builder.runConfig(runConfig);
}
return builder.build();
}
use of io.fabric8.maven.docker.config.CopyConfiguration.Builder in project docker-maven-plugin by fabric8io.
the class BaseMojoTest method singleImageWithCopyNamePatternAndCopyEntries.
protected ImageConfiguration singleImageWithCopyNamePatternAndCopyEntries(String copyNamePattern, List<CopyConfiguration.Entry> entries) {
final CopyConfiguration.Builder copyConfigBuilder = new CopyConfiguration.Builder();
if (entries != null) {
copyConfigBuilder.entries(entries);
}
final Builder builder = new Builder().name("example:latest");
if (copyNamePattern != null) {
builder.copyNamePattern(copyNamePattern);
}
return builder.copyConfig(copyConfigBuilder.build()).build();
}
use of io.fabric8.maven.docker.config.CopyConfiguration.Builder in project docker-maven-plugin by fabric8io.
the class UrlBuilderTest method listContainers.
@Test
public void listContainers() throws MalformedURLException, UnsupportedEncodingException, URISyntaxException {
UrlBuilder builder = new UrlBuilder("", "1.0");
assertEquals(new URI("/1.0/containers/json?all=0"), new URI(builder.listContainers(false)));
assertEquals(new URI("/1.0/containers/json?all=1&filters=" + URLEncoder.encode("{\"ancestor\":[\"nginx\"]}", "UTF8")), new URI(builder.listContainers(true, "ancestor", "nginx")));
try {
builder.listContainers(false, "ancestor");
fail();
} catch (IllegalArgumentException exp) {
assertTrue(exp.getMessage().contains("pair"));
}
}
use of io.fabric8.maven.docker.config.CopyConfiguration.Builder in project docker-maven-plugin by fabric8io.
the class UrlBuilderTest method listImages.
@Test
public void listImages() throws MalformedURLException, UnsupportedEncodingException, URISyntaxException {
UrlBuilder builder = new UrlBuilder("", "1.0");
assertEquals(new URI("/1.0/images/json?all=0"), new URI(builder.listImages(false)));
assertEquals(new URI("/1.0/images/json?all=1"), new URI(builder.listImages(true)));
}
use of io.fabric8.maven.docker.config.CopyConfiguration.Builder in project docker-maven-plugin by fabric8io.
the class UrlBuilderTest method getImage.
@Test
public void getImage() throws URISyntaxException {
UrlBuilder builder = new UrlBuilder("", "1.0");
assertEquals(new URI("/1.0/images/n1%3Alatest/get"), new URI(builder.getImage(new ImageName("n1:latest"))));
}
Aggregations