use of org.kie.workbench.common.screens.archetype.mgmt.backend.maven.AbstractMavenCommand in project kie-wb-common by kiegroup.
the class ArchetypeServiceImplTest method executeMavenWhenHasExceptionsTest.
@Test(expected = MavenExecutionException.class)
public void executeMavenWhenHasExceptionsTest() throws MavenEmbedderException {
final AbstractMavenCommand command = mock(AbstractMavenCommand.class);
final MavenExecutionResult result = mock(MavenExecutionResult.class);
doReturn(true).when(result).hasExceptions();
doReturn(result).when(command).execute();
service.executeMaven(command);
}
use of org.kie.workbench.common.screens.archetype.mgmt.backend.maven.AbstractMavenCommand in project kie-wb-common by kiegroup.
the class ArchetypeServiceImplTest method executeMavenSuccessTest.
@Test
public void executeMavenSuccessTest() throws MavenEmbedderException {
final AbstractMavenCommand command = mock(AbstractMavenCommand.class);
doReturn(mock(MavenExecutionResult.class)).when(command).execute();
try {
service.executeMaven(command);
} catch (Exception e) {
fail("Should not have thrown any exception");
}
}
Aggregations