use of org.guvnor.ala.wildfly.config.WildflyRuntimeExecConfig in project kie-wb-common by kiegroup.
the class ContextAwareWildflyRuntimeExecConfigTest method testContextUsingPath.
@Test
public void testContextUsingPath() {
final ContextAwareWildflyRuntimeExecConfig config = new ContextAwareWildflyRuntimeExecConfig();
final WildflyProvider provider = mock(WildflyProvider.class);
final Map<String, Object> context = singletonMap("wildfly-provider", provider);
config.setContext(context);
assertEquals(provider, config.getProviderId());
assertEquals(WAR_PATH_DEFAULT_EXPRESSION, config.getWarPath());
final WildflyRuntimeExecConfig configClone = config.asNewClone(config);
assertEquals(provider, configClone.getProviderId());
assertEquals(WAR_PATH_DEFAULT_EXPRESSION, configClone.getWarPath());
}
use of org.guvnor.ala.wildfly.config.WildflyRuntimeExecConfig in project kie-wb-common by kiegroup.
the class ContextAwareWildflyRuntimeExecConfigTest method testContextUsingMavenBinary.
@Test
public void testContextUsingMavenBinary() {
final ContextAwareWildflyRuntimeExecConfig config = new ContextAwareWildflyRuntimeExecConfig();
final Map<String, Object> context = new HashMap<>();
final WildflyProvider provider = mock(WildflyProvider.class);
context.put("wildfly-provider", provider);
final MavenBinary binary = mock(MavenBinary.class);
final Path path = mock(Path.class);
when(binary.getPath()).thenReturn(path);
when(path.toString()).thenReturn(FILE_PATH);
context.put("binary", binary);
config.setContext(context);
assertEquals(provider, config.getProviderId());
assertEquals(FILE_PATH, config.getWarPath());
final WildflyRuntimeExecConfig configClone = config.asNewClone(config);
assertEquals(provider, configClone.getProviderId());
assertEquals(FILE_PATH, configClone.getWarPath());
}
Aggregations