@@ -0,0 +1,2457 @@
+/*%0A * Copyright 2016 Red Hat Inc.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage enmasse.storage.controller.openshift;%0A%0Aimport com.openshift.internal.restclient.model.ReplicationController;%0Aimport com.openshift.restclient.IClient;%0Aimport com.openshift.restclient.ResourceKind;%0Aimport enmasse.storage.controller.model.AddressType;%0Aimport enmasse.storage.controller.model.LabelKeys;%0Aimport org.jboss.dmr.ModelNode;%0Aimport org.junit.Test;%0A%0Aimport java.util.Collections;%0Aimport java.util.List;%0A%0Aimport static org.hamcrest.CoreMatchers.is;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0Apublic class OpenshiftClientTest %7B%0A    @Test%0A    public void testListClusters() %7B%0A        IClient client = mock(IClient.class);%0A        OpenshiftClient osClient = new OpenshiftClient(client, %22myspace%22);%0A        ReplicationController controller = new ReplicationController(new ModelNode(), client, Collections.emptyMap());%0A        controller.addLabel(LabelKeys.FLAVOR, %22vanilla%22);%0A        controller.addLabel(LabelKeys.ADDRESS_TYPE, AddressType.QUEUE.value());%0A        controller.addLabel(LabelKeys.ADDRESS, %22foo%22);%0A        when(client.list(ResourceKind.REPLICATION_CONTROLLER, %22myspace%22)).thenReturn(Collections.singletonList(controller));%0A%0A        List%3CStorageCluster%3E clusters = osClient.listClusters();%0A        verify(client).list(ResourceKind.REPLICATION_CONTROLLER, %22myspace%22);%0A        assertThat(clusters.size(), is(1));%0A        StorageCluster cluster = clusters.get(0);%0A        assertThat(cluster.getDestination().address(), is(%22foo%22));%0A        assertThat(cluster.getDestination().flavor(), is(%22vanilla%22));%0A        assertTrue(cluster.getDestination().storeAndForward());%0A        assertFalse(cluster.getDestination().multicast());%0A    %7D%0A%7D%0A

Add test for openshift client