### Question:
DockerRegistryManager implements SecuredEntityManager { @Transactional(propagation = Propagation.REQUIRED) public DockerRegistry delete(Long id, boolean force) { DockerRegistry registry = dockerRegistryDao.loadDockerRegistry(id); if (force) { toolGroupManager.loadByRegistryId(id).forEach(g -> toolGroupManager.delete(g.getId().toString(), force)); } if (StringUtils.isNotBlank(registry.getSecretName())) { kubernetesManager.deleteSecret(registry.getSecretName()); } dockerRegistryDao.deleteDockerRegistry(id); return registry; }  @Transactional(propagation = Propagation.REQUIRED) DockerRegistry create(DockerRegistryVO dockerRegistryVO); @Transactional(propagation = Propagation.REQUIRED) DockerRegistry updateDockerRegistry(DockerRegistry dockerRegistry); @Transactional(propagation = Propagation.REQUIRED) DockerRegistry updateDockerRegistryCredentials(DockerRegistryVO dockerRegistryVO); @Override DockerRegistry load(Long id); @Override AbstractSecuredEntity changeOwner(Long id, String owner); @Override AclClass getSupportedClass(); DockerRegistry loadByNameOrId(String registryPath); @Override Integer loadTotalCount(); @Override Collection<? extends AbstractSecuredEntity> loadAllWithParents(Integer page, Integer pageSize); @Override DockerRegistry loadWithParents(final Long id); DockerRegistry loadByExternalUrl(String externalUrl); List<DockerRegistry> loadAllDockerRegistry(); DockerRegistryList listAllDockerRegistriesWithCerts(); @Transactional(propagation = Propagation.REQUIRED) DockerRegistry delete(Long id, boolean force); @Transactional(propagation = Propagation.REQUIRED) List<Tool> notifyDockerRegistryEvents(String registry, DockerRegistryEventEnvelope events); Set<String> getRegistryEntries(DockerRegistry registry); void setDockerClientFactory(DockerClientFactory dockerClientFactory); ImageDescription getImageDescription(DockerRegistry registry, String imageName, String tag); List<ImageHistoryLayer> getImageHistory(final DockerRegistry registry, final String imageName,
                                                   final String tag); List<String> loadImageTags(DockerRegistry registry, Tool tool); List<String> loadImageTags(DockerRegistry registry, String image); Optional<ManifestV2> deleteImage(DockerRegistry registry, String image, String tag); void deleteLayer(DockerRegistry registry, String image, String digest); byte[] getCertificateContent(Long id); JwtRawToken issueTokenForDockerRegistry(String userName, String token,
            String dockerRegistryHost, String scope); byte[] getConfigScript(Long id); DockerRegistryList loadAllRegistriesContent(); @Transactional(propagation = Propagation.REQUIRED) void checkDockerSecrets(); DockerRegistry getDockerRegistryTree(Long registryId); String getImageToken(DockerRegistry registry, String imageName); DockerClient getDockerClient(DockerRegistry registry, String image);  }### Answer:
@Test @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Throwable.class) public void testDelete() { TestUtils.configureDockerClientMock(Mockito.mock(DockerClient.class), dockerClientFactoryMock); DockerRegistry registry = generateRegistry(); registryDao.createDockerRegistry(registry); ToolGroup group = generateToolGroup(registry); toolGroupDao.createToolGroup(group); Tool tool = generateTool(group); toolManager.create(tool, true); dockerRegistryManager.delete(registry.getId(), true); }