@Test public void testVerifyAlreadyDeployedValidatedNonSNAPSHOT() { prepareProjectIsDeployed(true); when(gav.isSnapshot()).thenReturn(false); try { deploymentVerifier.verifyWithException(module, DeploymentMode.VALIDATED); } catch (Exception e) { exception = e; } assertNotNull(exception); assertTrue(exception instanceof GAVAlreadyExistsException); assertEquals(gav, ((GAVAlreadyExistsException) exception).getGAV()); assertEquals(repositories, ((GAVAlreadyExistsException) exception).getRepositories()); }
public void verifyWithException(final Module module, DeploymentMode deploymentMode) { if (DeploymentMode.VALIDATED.equals(deploymentMode)) { final GAV gav = module.getPom().getGav(); if (gav.isSnapshot()) { return; } final ModuleRepositories projectRepositories = moduleRepositoriesService.load(((KieModule) module).getRepositoriesPath()); final Set<MavenRepositoryMetadata> repositories = repositoryResolver.getRepositoriesResolvingArtifact(gav, module, projectRepositories.filterByIncluded()); if (repositories.size() > 0) { throw new GAVAlreadyExistsException(gav, repositories); } } }
DeploymentVerifier { public void verifyWithException(final Module module, DeploymentMode deploymentMode) { if (DeploymentMode.VALIDATED.equals(deploymentMode)) { final GAV gav = module.getPom().getGav(); if (gav.isSnapshot()) { return; } final ModuleRepositories projectRepositories = moduleRepositoriesService.load(((KieModule) module).getRepositoriesPath()); final Set<MavenRepositoryMetadata> repositories = repositoryResolver.getRepositoriesResolvingArtifact(gav, module, projectRepositories.filterByIncluded()); if (repositories.size() > 0) { throw new GAVAlreadyExistsException(gav, repositories); } } } }
DeploymentVerifier { public void verifyWithException(final Module module, DeploymentMode deploymentMode) { if (DeploymentMode.VALIDATED.equals(deploymentMode)) { final GAV gav = module.getPom().getGav(); if (gav.isSnapshot()) { return; } final ModuleRepositories projectRepositories = moduleRepositoriesService.load(((KieModule) module).getRepositoriesPath()); final Set<MavenRepositoryMetadata> repositories = repositoryResolver.getRepositoriesResolvingArtifact(gav, module, projectRepositories.filterByIncluded()); if (repositories.size() > 0) { throw new GAVAlreadyExistsException(gav, repositories); } } } DeploymentVerifier(); @Inject  DeploymentVerifier(final ModuleRepositoryResolver repositoryResolver,
                              final ModuleRepositoriesService moduleRepositoriesService); }
DeploymentVerifier { public void verifyWithException(final Module module, DeploymentMode deploymentMode) { if (DeploymentMode.VALIDATED.equals(deploymentMode)) { final GAV gav = module.getPom().getGav(); if (gav.isSnapshot()) { return; } final ModuleRepositories projectRepositories = moduleRepositoriesService.load(((KieModule) module).getRepositoriesPath()); final Set<MavenRepositoryMetadata> repositories = repositoryResolver.getRepositoriesResolvingArtifact(gav, module, projectRepositories.filterByIncluded()); if (repositories.size() > 0) { throw new GAVAlreadyExistsException(gav, repositories); } } } DeploymentVerifier(); @Inject  DeploymentVerifier(final ModuleRepositoryResolver repositoryResolver,
                              final ModuleRepositoriesService moduleRepositoriesService); void verifyWithException(final Module module,
                                    DeploymentMode deploymentMode); }
DeploymentVerifier { public void verifyWithException(final Module module, DeploymentMode deploymentMode) { if (DeploymentMode.VALIDATED.equals(deploymentMode)) { final GAV gav = module.getPom().getGav(); if (gav.isSnapshot()) { return; } final ModuleRepositories projectRepositories = moduleRepositoriesService.load(((KieModule) module).getRepositoriesPath()); final Set<MavenRepositoryMetadata> repositories = repositoryResolver.getRepositoriesResolvingArtifact(gav, module, projectRepositories.filterByIncluded()); if (repositories.size() > 0) { throw new GAVAlreadyExistsException(gav, repositories); } } } DeploymentVerifier(); @Inject  DeploymentVerifier(final ModuleRepositoryResolver repositoryResolver,
                              final ModuleRepositoriesService moduleRepositoriesService); void verifyWithException(final Module module,
                                    DeploymentMode deploymentMode);  }