villager/src/test/java/io/charlescd/villager/interactor/service/impl/RegistryServiceImplTest.java
//TODO: Fix test after DOCKER_HUB Registry implementation
Fix test after DOCKER_HUB Registry implementation
Fix test after DOCKER_HUB Registry implementation
@Test
    public void testTestRegistryDockerHub() {
        var registryType = RegistryType.DOCKER_HUB;
        var entity = DockerRegistryTestUtils.generateDockerRegistryConfigurationEntity(registryType);
        var serviceImpl = new RegistryServiceImpl(dockerRegistryConfigurationRepository, registryClient);
        when(registryClient.getImage(ARTIFACT_NAME, TAG_NAME, entity.connectionData)).thenReturn(Optional.of(Response.status(404).build()));
        assertThrows(IllegalStateException.class, () -> serviceImpl.testRegistryConnectivityConfig(entity));
        verify(registryClient, times(1))
                .configureAuthentication(registryType, entity.connectionData, ARTIFACT_NAME);
    }
@ Test public void testTestRegistryDockerHub ( ) { var registryType = RegistryType . DOCKER_HUB ; var entity = DockerRegistryTestUtils . generateDockerRegistryConfigurationEntity ( registryType ) ; var serviceImpl = new RegistryServiceImpl ( dockerRegistryConfigurationRepository , registryClient ) ; when ( registryClient . getImage ( ARTIFACT_NAME , TAG_NAME , entity . connectionData ) ) . thenReturn ( Optional . of ( Response . status ( 404 ) . build ( ) ) ) ; assertThrows ( IllegalStateException . class , ( ) -> serviceImpl . testRegistryConnectivityConfig ( entity ) ) ; verify ( registryClient , times ( 1 ) ) . configureAuthentication ( registryType , entity . connectionData , ARTIFACT_NAME ) ; }
TODO: Fix test after DOCKER_HUB Registry implementation
TODO : Fix test after DOCKER_HUB Registry implementation