use of org.kie.server.controller.api.model.runtime.ServerInstance in project kie-wb-common by kiegroup.
the class RemotePresenterTest method testOnInstanceUpdate.
@Test
public void testOnInstanceUpdate() {
final ServerInstance serverInstance = new ServerInstance("templateId", "serverName", "serverInstanceId", "url", "1.0", Collections.<Message>emptyList(), Collections.<Container>emptyList());
presenter.onSelect(new ServerInstanceSelected(serverInstance));
presenter.onInstanceUpdate(new ServerInstanceUpdated(serverInstance));
verify(view, times(2)).clear();
verify(view, times(2)).setServerName(serverInstance.getServerName());
verify(view, times(2)).setServerURL(serverInstance.getUrl());
verify(view, times(2)).setEmptyView(remoteEmptyPresenter.getView());
}
use of org.kie.server.controller.api.model.runtime.ServerInstance in project kie-wb-common by kiegroup.
the class RemotePresenterTest method testOnInstanceUpdateDifferentServer.
@Test
public void testOnInstanceUpdateDifferentServer() {
final ServerInstance serverInstance = new ServerInstance("templateId", "serverName", "serverInstanceId", "url", "1.0", Collections.<Message>emptyList(), Collections.<Container>emptyList());
presenter.onSelect(new ServerInstanceSelected(serverInstance));
final ServerInstance serverInstance2 = new ServerInstance("templateId2", "serverName2", "serverInstanceId2", "url", "1.0", Collections.<Message>emptyList(), Collections.<Container>emptyList());
presenter.onInstanceUpdate(new ServerInstanceUpdated(serverInstance2));
verify(view).clear();
verify(view).setServerName(serverInstance.getServerName());
verify(view).setServerURL(serverInstance.getUrl());
verify(view).setEmptyView(remoteEmptyPresenter.getView());
}
use of org.kie.server.controller.api.model.runtime.ServerInstance in project kie-wb-common by kiegroup.
the class ConvertTest method testToKey.
@Test
public void testToKey() {
final String serverTemplateId = "serverTemplateId";
final String serverName = "serverName";
final String serverInstanceId = "serverInstanceId";
final String url = "url";
ServerInstance serverInstance = new ServerInstance(serverTemplateId, serverName, serverInstanceId, url, "version", new ArrayList<Message>(), new ArrayList<Container>());
ServerInstanceKey key = Convert.toKey(serverInstance);
assertEquals(serverTemplateId, key.getServerTemplateId());
assertEquals(serverName, key.getServerName());
assertEquals(serverInstanceId, key.getServerInstanceId());
assertEquals(url, key.getUrl());
}
Aggregations