use of org.jboss.tools.openshift.core.connection.Connection in project jbosstools-openshift by jbosstools.
the class OpenShiftServerUtilsTest method should_not_return_connection_from_server_given_malformed_url.
@Test
public void should_not_return_connection_from_server_given_malformed_url() {
// given
doReturn("htt:/bogus").when(server).getAttribute(eq(OpenShiftServerUtils.ATTR_CONNECTIONURL), anyString());
// when
Connection connection = OpenShiftServerUtils.getConnection(server);
// then
assertThat(connection).isNull();
}
use of org.jboss.tools.openshift.core.connection.Connection in project jbosstools-openshift by jbosstools.
the class OpenShiftServerUtilsTest method should_not_return_connection_from_server_given_non_registered_connection.
@Test
public void should_not_return_connection_from_server_given_non_registered_connection() {
// given
ConnectionsRegistrySingleton.getInstance().clear();
// when
Connection connection = OpenShiftServerUtils.getConnection(server);
// then
assertThat(connection).isNull();
}
use of org.jboss.tools.openshift.core.connection.Connection in project jbosstools-openshift by jbosstools.
the class OpenShiftExplorerContentProviderTest method modelShouldNotifyConnectionAddedInRegistry.
@Test
public void modelShouldNotifyConnectionAddedInRegistry() throws InterruptedException, MalformedURLException {
// given
Connection connection2 = ConnectionTestUtils.createConnection("anotherUser", "654321", "https://127.0.0.1:8181");
IElementListener listener = spy(new VoidElementListener());
model.addListener(listener);
// when
registry.add(connection2);
// then
verify(listener, timeout(10 * 1000)).elementChanged(any());
}
use of org.jboss.tools.openshift.core.connection.Connection in project jbosstools-openshift by jbosstools.
the class DeployImageWizardModelTest method should_load_resources_if_were_not_loaded_yet_and_same_connection_is_set_again.
@Test
public void should_load_resources_if_were_not_loaded_yet_and_same_connection_is_set_again() {
// JBIDE-24499
// given
Connection connection2 = mock(Connection.class);
TestableDeployImageWizardModel model = createModel(project, connection2, dockerConnection);
// not loaded yet
verify(connection2, never()).getResources(ResourceKind.PROJECT);
// set same connection
model.setConnection(connection2);
// when
model.loadResources();
// then
// still load resources
verify(connection2, times(1)).getResources(ResourceKind.PROJECT);
}
use of org.jboss.tools.openshift.core.connection.Connection in project jbosstools-openshift by jbosstools.
the class DeployImageWizardModelTest method should_reload_resources_if_connection_was_changed.
@Test
public void should_reload_resources_if_connection_was_changed() {
// given
Connection connection2 = mock(Connection.class);
model.setConnection(connection2);
// when
model.loadResources();
// then
verify(connection2, times(1)).getResources(ResourceKind.PROJECT);
}
Aggregations