Search in sources :

Example 1 with ConnectionNotFoundException

use of org.jboss.tools.openshift.core.connection.ConnectionNotFoundException in project jbosstools-openshift by jbosstools.

the class ConnectionsRegistryUtilTest method testConnectionNotFound.

@Test
public void testConnectionNotFound() {
    String kind = "foo";
    String name = "bar";
    try {
        IResource resource = mock(IResource.class);
        when(resource.getKind()).thenReturn(kind);
        when(resource.getName()).thenReturn(name);
        ConnectionsRegistryUtil.getConnectionFor(resource);
        fail();
    } catch (ConnectionNotFoundException e) {
        assertEquals("Unable to find the connection for a " + kind + " named " + name, e.getMessage());
    }
}
Also used : ConnectionNotFoundException(org.jboss.tools.openshift.core.connection.ConnectionNotFoundException) IResource(com.openshift.restclient.model.IResource) Test(org.junit.Test)

Aggregations

IResource (com.openshift.restclient.model.IResource)1 ConnectionNotFoundException (org.jboss.tools.openshift.core.connection.ConnectionNotFoundException)1 Test (org.junit.Test)1