use of io.fabric8.maven.docker.model.ImageArchiveManifestAdapter in project docker-maven-plugin by fabric8io.
the class ImageArchiveUtilTest method findByRepoTagNonEmptyManifest.
@Test
public void findByRepoTagNonEmptyManifest() {
ImageArchiveManifest nonEmpty = new ImageArchiveManifestAdapter(createBasicManifestJson());
Assert.assertNull(ImageArchiveUtil.findEntryByRepoTag("anything", nonEmpty));
// Prefix
Assert.assertNull(ImageArchiveUtil.findEntryByRepoTag("test", nonEmpty));
// Prefix
Assert.assertNull(ImageArchiveUtil.findEntryByRepoTag("test/image", nonEmpty));
}
use of io.fabric8.maven.docker.model.ImageArchiveManifestAdapter in project docker-maven-plugin by fabric8io.
the class ImageArchiveUtilTest method findEntriesByRepoTagPatternNonEmptyManifest.
@Test
public void findEntriesByRepoTagPatternNonEmptyManifest() {
ImageArchiveManifest nonEmpty = new ImageArchiveManifestAdapter(createBasicManifestJson());
Map<String, ImageArchiveManifestEntry> entries;
entries = ImageArchiveUtil.findEntriesByRepoTagPattern("does/not:match", nonEmpty);
Assert.assertNotNull(entries);
Assert.assertTrue(entries.isEmpty());
// Anchored pattern
entries = ImageArchiveUtil.findEntriesByRepoTagPattern("^test/image$", nonEmpty);
Assert.assertNotNull(entries);
Assert.assertTrue(entries.isEmpty());
}
use of io.fabric8.maven.docker.model.ImageArchiveManifestAdapter in project docker-maven-plugin by fabric8io.
the class ImageArchiveUtilTest method findByRepoTagPatternInvalidPattern.
@Test(expected = PatternSyntaxException.class)
public void findByRepoTagPatternInvalidPattern() {
ImageArchiveManifest nonEmpty = new ImageArchiveManifestAdapter(createBasicManifestJson());
Assert.assertNull(ImageArchiveUtil.findEntryByRepoTagPattern("*(?", nonEmpty));
}
use of io.fabric8.maven.docker.model.ImageArchiveManifestAdapter in project docker-maven-plugin by fabric8io.
the class ImageArchiveUtilTest method findByRepoTagEmptyManifest.
@Test
public void findByRepoTagEmptyManifest() {
ImageArchiveManifest empty = new ImageArchiveManifestAdapter(new JsonArray());
Assert.assertNull(ImageArchiveUtil.findEntryByRepoTag("anything", empty));
Assert.assertNull(ImageArchiveUtil.findEntryByRepoTag("anything", null));
Assert.assertNull(ImageArchiveUtil.findEntryByRepoTag(null, null));
}
use of io.fabric8.maven.docker.model.ImageArchiveManifestAdapter in project docker-maven-plugin by fabric8io.
the class ImageArchiveUtilTest method findEntriesByRepoTagPatternInvalidPattern.
@Test(expected = PatternSyntaxException.class)
public void findEntriesByRepoTagPatternInvalidPattern() {
ImageArchiveManifest nonEmpty = new ImageArchiveManifestAdapter(createBasicManifestJson());
Assert.assertNull(ImageArchiveUtil.findEntryByRepoTagPattern("*(?", nonEmpty));
}
Aggregations