use of org.kie.server.api.model.ReleaseId in project kie-wb-common by kiegroup.
the class InfoTitlePresenterTest method testSetup.
@Test
public void testSetup() {
final ReleaseId releaseId = new ReleaseId("com.company", "artifact-id", "1.0.0");
presenter.setup(releaseId);
verify(view).setup(releaseId.getGroupId(), releaseId.getArtifactId());
}
use of org.kie.server.api.model.ReleaseId in project kie-wb-common by kiegroup.
the class NewContainerFormPresenterTest method testNewContainerStarted.
@Test
public void testNewContainerStarted() {
final String path = "org:kie:1.0";
final GAV gav = new GAV(path);
when(m2RepoService.loadGAVFromJar(path)).thenReturn(gav);
when(view.getContainerName()).thenReturn("containerName");
when(view.getContainerAlias()).thenReturn("containerAlias");
when(view.getGroupId()).thenReturn(gav.getGroupId());
when(view.getArtifactId()).thenReturn(gav.getArtifactId());
when(view.getVersion()).thenReturn(gav.getVersion());
when(view.isStartContainer()).thenReturn(true);
presenter.asWidget();
final ContainerSpec containerSpec = presenter.buildContainerSpec("templateId", Collections.<Capability, ContainerConfig>emptyMap());
assertEquals(new ReleaseId(gav.getGroupId(), gav.getArtifactId(), gav.getVersion()), containerSpec.getReleasedId());
assertEquals(KieContainerStatus.STARTED, containerSpec.getStatus());
assertEquals("containerAlias", containerSpec.getContainerName());
assertEquals("containerName", containerSpec.getId());
}
use of org.kie.server.api.model.ReleaseId in project kie-wb-common by kiegroup.
the class NewContainerFormPresenterTest method testOnDependencyPathSelectedEvent.
@Test
public void testOnDependencyPathSelectedEvent() {
final String path = "org:kie:1.0";
final GAV gav = new GAV(path);
when(m2RepoService.loadGAVFromJar(path)).thenReturn(gav);
when(view.getContainerName()).thenReturn("containerName");
when(view.getContainerAlias()).thenReturn("containerAlias");
when(view.getGroupId()).thenReturn(gav.getGroupId());
when(view.getArtifactId()).thenReturn(gav.getArtifactId());
when(view.getVersion()).thenReturn(gav.getVersion());
presenter.asWidget();
presenter.onDependencyPathSelectedEvent(new DependencyPathSelectedEvent(artifactListWidgetPresenter, path));
verify(m2RepoService).loadGAVFromJar(path);
verify(view).setGroupId(gav.getGroupId());
verify(view).setArtifactId(gav.getArtifactId());
verify(view).setVersion(gav.getVersion());
verify(wizardPageStatusChangeEvent).fire(any(WizardPageStatusChangeEvent.class));
final ContainerSpec containerSpec = presenter.buildContainerSpec("templateId", Collections.<Capability, ContainerConfig>emptyMap());
assertEquals(new ReleaseId(gav.getGroupId(), gav.getArtifactId(), gav.getVersion()), containerSpec.getReleasedId());
assertEquals(KieContainerStatus.STOPPED, containerSpec.getStatus());
assertEquals("containerAlias", containerSpec.getContainerName());
assertEquals("containerName", containerSpec.getId());
}
Aggregations