use of com.epam.pipeline.entity.docker.ImageDescription in project cloud-pipeline by epam.
the class DockerRegistryManagerTest method testLoadingImageDescription.
@Test
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void testLoadingImageDescription() {
DockerRegistry registry = generateRegistry();
Date date = new Date();
registryDao.createDockerRegistry(registry);
ToolGroup group = generateToolGroup(registry);
toolGroupDao.createToolGroup(group);
Tool tool = generateTool(group);
toolManager.create(tool, true);
DockerClient mockClient = Mockito.mock(DockerClient.class);
when(dockerClientFactoryMock.getDockerClient(any(DockerRegistry.class), any())).thenReturn(mockClient);
ImageDescription expected = new ImageDescription(1L, TEST_IMAGE, TEST_TAG, date);
when(mockClient.getImageDescription(registry, tool.getName(), TEST_TAG)).thenReturn(expected);
Assert.assertEquals(expected, dockerRegistryManager.getImageDescription(registry, tool.getName(), TEST_TAG));
}
Aggregations