Search in sources :

Example 1 with JibServiceUtil

use of io.fabric8.maven.docker.util.JibServiceUtil in project docker-maven-plugin by fabric8io.

the class JibBuildServiceTest method testPushWithConfiguration.

@Test
public void testPushWithConfiguration(@Mocked JibServiceUtil jibServiceUtil) throws Exception {
    // Given
    File projectBaseDir = Files.createTempDirectory("test").toFile();
    setupServiceHubExpectations(projectBaseDir);
    final ImageConfiguration imageConfiguration = getImageConfiguration();
    final RegistryService.RegistryConfig registryConfig = new RegistryService.RegistryConfig.Builder().authConfigFactory(authConfigFactory).build();
    mockAuthConfigFactory(true, registryConfig);
    // When
    new JibBuildService(serviceHub, params, logger).push(Collections.singletonList(imageConfiguration), 1, registryConfig, false);
    // Then
    // @formatter:off
    new Verifications() {

        {
            JibServiceUtil.jibPush(imageConfiguration, Credential.from("testuserpush", "testpass"), (File) any, logger);
            times = 1;
        }
    };
// @formatter:on
}
Also used : BuildImageConfiguration(io.fabric8.maven.docker.config.BuildImageConfiguration) ImageConfiguration(io.fabric8.maven.docker.config.ImageConfiguration) Verifications(mockit.Verifications) File(java.io.File) Test(org.junit.Test)

Aggregations

BuildImageConfiguration (io.fabric8.maven.docker.config.BuildImageConfiguration)1 ImageConfiguration (io.fabric8.maven.docker.config.ImageConfiguration)1 File (java.io.File)1 Verifications (mockit.Verifications)1 Test (org.junit.Test)1