public void update(String namespaceName, String extensionName) throws InterruptedException {
        if(BuiltInExtensionUtil.isBuiltIn(namespaceName)) {
            LOGGER.debug("SKIP BUILT-IN EXTENSION {}", NamingUtil.toExtensionId(namespaceName, extensionName));
            return;
        }

        var extension = repositories.findPublicId(namespaceName, extensionName);
        var extensionUpdates = new HashMap<Long, String>();
        updateExtensionPublicId(extension, extensionUpdates, false);
        if(!extensionUpdates.isEmpty()) {
            repositories.updateExtensionPublicIds(extensionUpdates);
        }

        var namespaceUpdates = new HashMap<Long, String>();
        updateNamespacePublicId(extension, namespaceUpdates, false);
        if(!namespaceUpdates.isEmpty()) {
            repositories.updateNamespacePublicIds(namespaceUpdates);
        }
    }
@Test
    public void testMustUpdateRandom() throws InterruptedException {
        var namespaceName1 = "foo";
        var namespacePublicId1 = UUID.randomUUID().toString();
        var extensionName1 = "bar";
        var extensionPublicId1 = UUID.randomUUID().toString();

        var namespace1 = new Namespace();
        namespace1.setId(1L);
        namespace1.setName(namespaceName1);

        var extension1 = new Extension();
        extension1.setId(2L);
        extension1.setName(extensionName1);
        extension1.setNamespace(namespace1);

        var namespaceName2 = "baz";
        var namespacePublicId2 = UUID.randomUUID().toString();
        var extensionName2 = "foobar";
        var extensionPublicId2 = UUID.randomUUID().toString();

        var namespace2 = new Namespace();
        namespace2.setId(3L);
        namespace2.setName(namespaceName2);
        namespace2.setPublicId(namespacePublicId1);

        var extension2 = new Extension();
        extension2.setId(4L);
        extension2.setName(extensionName2);
        extension2.setPublicId(extensionPublicId1);
        extension2.setNamespace(namespace2);

        Mockito.when(repositories.findPublicId(namespaceName1, extensionName1)).thenReturn(extension1);
        Mockito.when(repositories.findPublicId(extensionPublicId1)).thenReturn(extension2);
        Mockito.when(repositories.findNamespacePublicId(namespacePublicId1)).thenReturn(extension2);
        var upstreamPublicIds = new PublicIds(namespacePublicId1, extensionPublicId1);
        Mockito.when(idService.getUpstreamPublicIds(extension1)).thenReturn(upstreamPublicIds);
        Mockito.when(idService.getUpstreamPublicIds(extension2)).thenReturn(upstreamPublicIds);
        Mockito.when(idService.getRandomPublicId()).thenReturn(extensionPublicId2, namespacePublicId2);

        updateService.update(namespaceName1, extensionName1);
        Mockito.verify(repositories).updateExtensionPublicIds(Mockito.argThat((Map<Long, String> map) -> {
            return map.size() == 2
                    && map.get(extension1.getId()).equals(extensionPublicId1)
                    && map.get(extension2.getId()).equals(extensionPublicId2);
        }));
        Mockito.verify(repositories).updateNamespacePublicIds(Mockito.argThat((Map<Long, String> map) -> {
            return map.size() == 2
                    && map.get(namespace1.getId()).equals(namespacePublicId1)
                    && map.get(namespace2.getId()).equals(namespacePublicId2);
        }));
    }