public BuildResults buildAndDeploy(final Module module, final DeploymentMode mode) { deploymentVerifier.verifyWithException(module, mode); return doBuildAndDeploy(module, false); }
@Before public void setUp() { deploymentVerifier = new DeploymentVerifier(repositoryResolver, moduleRepositoriesService); when(module.getPom()).thenReturn(pom); when(pom.getGav()).thenReturn(gav); }
@Before public void setUp() throws Exception { testFileSystem = new TestFileSystem(); moduleService = testFileSystem.getReference(KieModuleService.class); pomService = testFileSystem.getReference(POMService.class); cache = testFileSystem.getReference(LRUBuilderCache.class); deploymentVerifier = new DeploymentVerifier(repositoryResolver, moduleRepositoriesService); buildHelper = spy(new BuildHelper(pomService, m2RepoService, moduleService, deploymentVerifier, cache, handlers, identity)); when(identity.get()).thenReturn(user); when(user.getIdentifier()).thenReturn("test-user"); URL rootUrl = this.getClass().getResource("/BuildHelperTest"); rootPath = Paths.convert(testFileSystem.fileSystemProvider.getPath(rootUrl.toURI())); rootUrl = this.getClass().getResource("/BuildHelperTestSnapshot"); snapshotRootPath = Paths.convert(testFileSystem.fileSystemProvider.getPath(rootUrl.toURI())); Iterator<PostBuildHandler> mockIterator = mock(Iterator.class); when(handlers.iterator()).thenReturn(mockIterator); when(mockIterator.hasNext()).thenReturn(false); }
public BuildResults buildAndDeploy(final Module module, final boolean suppressHandlers, final DeploymentMode mode) { deploymentVerifier.verifyWithException(module, mode); return doBuildAndDeploy(module, suppressHandlers); }
private void invokeLocalBuildPipeLine(Module module, boolean suppressHandlers, DeploymentMode mode, Consumer<LocalBinaryConfig> consumer) { deploymentVerifier.verifyWithException(module, mode); BuildPipelineInvoker.LocalBuildRequest buildRequest = BuildPipelineInvoker.LocalBuildRequest.newFullBuildAndDeployRequest(module, toDeploymentType(mode), suppressHandlers); buildPipelineInvoker.invokeLocalBuildPipeLine(buildRequest, consumer); }
private void executeNonErrorCase(DeploymentMode deploymentMode) { try { deploymentVerifier.verifyWithException(module, deploymentMode); } catch (Exception e) { exception = e; } assertNull(exception); }
/** * Test the case when a VALIDATED deployment is about to be performed, the module is deployed, and the module * version is a non snapshot. */ @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()); }