use of org.jboss.tools.openshift.internal.ui.server.ServerSettingsWizardPageModel in project jbosstools-openshift by jbosstools.
the class ServerSettingsWizardPageModelTest method shouldInitializeUseImageDevmodeKeyToFalseIfKeyIsPresent.
@Test
public void shouldInitializeUseImageDevmodeKeyToFalseIfKeyIsPresent() throws Exception {
// given
IServerWorkingCopy server = spy(OpenShiftServerTestUtils.createOpenshift3ServerWorkingCopy("aServer", null, null, null));
doReturn("aDevmodeKey").when(server).getAttribute(eq(OpenShiftServerUtils.ATTR_DEVMODE_KEY), anyString());
// when
ServerSettingsWizardPageModel model = createModel(null, null, null, null, null, server);
// then
assertThat(model.isUseImageDevmodeKey()).isFalse();
}
use of org.jboss.tools.openshift.internal.ui.server.ServerSettingsWizardPageModel in project jbosstools-openshift by jbosstools.
the class ServerSettingsWizardPageModelTest method shouldInitializeUseImageDebugPortKeyToTrueIfKeyIsNotPresent.
@Test
public void shouldInitializeUseImageDebugPortKeyToTrueIfKeyIsNotPresent() throws Exception {
// given
IServerWorkingCopy server = spy(OpenShiftServerTestUtils.createOpenshift3ServerWorkingCopy("aServer", null, null, null));
doReturn(null).when(server).getAttribute(eq(OpenShiftServerUtils.ATTR_DEBUG_PORT_KEY), anyString());
// when
ServerSettingsWizardPageModel model = createModel(null, null, null, null, null, server);
// then
assertThat(model.isUseImageDebugPortKey()).isTrue();
}
use of org.jboss.tools.openshift.internal.ui.server.ServerSettingsWizardPageModel in project jbosstools-openshift by jbosstools.
the class ServerSettingsWizardPageModelTest method shouldInitializeUseImageDebugPortValueToFalseIfKeyIsPresent.
@Test
public void shouldInitializeUseImageDebugPortValueToFalseIfKeyIsPresent() throws Exception {
// given
IServerWorkingCopy server = spy(OpenShiftServerTestUtils.createOpenshift3ServerWorkingCopy("aServer", null, null, null));
doReturn("debugPortValue").when(server).getAttribute(eq(OpenShiftServerUtils.ATTR_DEBUG_PORT_VALUE), anyString());
// when
ServerSettingsWizardPageModel model = createModel(null, null, null, null, null, server);
// then
assertThat(model.isUseImageDebugPortValue()).isFalse();
}
use of org.jboss.tools.openshift.internal.ui.server.ServerSettingsWizardPageModel in project jbosstools-openshift by jbosstools.
the class ServerSettingsWizardPageModelTest method shouldInitializeDebugPortKey.
@Test
public void shouldInitializeDebugPortKey() throws Exception {
// given
IServerWorkingCopy server = spy(OpenShiftServerTestUtils.createOpenshift3ServerWorkingCopy("aServer", null, null, null));
doReturn("aDebugPortKey").when(server).getAttribute(eq(OpenShiftServerUtils.ATTR_DEBUG_PORT_KEY), anyString());
// when
ServerSettingsWizardPageModel model = createModel(null, null, null, null, null, server);
// then
assertThat(model.getDebugPortKey()).isEqualTo("aDebugPortKey");
}
use of org.jboss.tools.openshift.internal.ui.server.ServerSettingsWizardPageModel in project jbosstools-openshift by jbosstools.
the class ServerSettingsWizardPageModelTest method shouldReturn1stServiceIfNoServiceMatchesGitRemoteOfProjectModelWasInitializedWith.
@Test
public void shouldReturn1stServiceIfNoServiceMatchesGitRemoteOfProjectModelWasInitializedWith() {
// given
ServerSettingsWizardPageModel model = createModel(null, null, project1, Arrays.asList(project1, project2, project3, project4), connection);
// when
IResource resource = model.getResource();
// then
assertThat(resource).isEqualTo(ResourceMocks.PROJECT2_SERVICES[0]);
}
Aggregations