Search in sources :

Example 11 with IImageStream

use of com.openshift.restclient.model.IImageStream in project jbosstools-openshift by jbosstools.

the class DeployImageJobTest method givenTheImageStreamExistsTo.

private void givenTheImageStreamExistsTo(String name) {
    IImageStream is = createResource(IImageStream.class, ResourceKind.IMAGE_STREAM);
    when(connection.getResource(ResourceKind.IMAGE_STREAM, project.getName(), name)).thenReturn(is);
}
Also used : IImageStream(com.openshift.restclient.model.IImageStream)

Example 12 with IImageStream

use of com.openshift.restclient.model.IImageStream in project jbosstools-openshift by jbosstools.

the class DeployImageJobTest method testStubImageStreamWhereOneAlreadyExistsInTheCommonProject.

@Test
public void testStubImageStreamWhereOneAlreadyExistsInTheCommonProject() {
    givenAnImageStreamTo(ICommonAttributes.COMMON_NAMESPACE, DOCKER_TAG);
    IImageStream is = whenStubbingTheImageStream(DOCKER_TAG_DIFF_REPO);
    assertNotNull("Exp. an IS to be returned", is);
    assertEquals(IMAGE_STREAM_NAME, is.getName());
    assertEquals(ICommonAttributes.COMMON_NAMESPACE, is.getNamespaceName());
    assertEquals(DOCKER_TAG, is.getDockerImageRepository());
}
Also used : IImageStream(com.openshift.restclient.model.IImageStream) Test(org.junit.Test)

Example 13 with IImageStream

use of com.openshift.restclient.model.IImageStream in project jbosstools-openshift by jbosstools.

the class CreateApplicationFromImageJobTest method testStubImageStream.

@Test
public void testStubImageStream() {
    IImageStream stub = mock(IImageStream.class);
    when(factory.stub(anyString(), anyString(), anyString())).thenReturn(stub);
    IImageStream is = job.stubImageStream(factory, APP_NAME, project, null);
    assertEquals(stub, is);
    verify(factory).stub(ResourceKind.IMAGE_STREAM, APP_NAME, project.getName());
}
Also used : IImageStream(com.openshift.restclient.model.IImageStream) Test(org.junit.Test)

Aggregations

IImageStream (com.openshift.restclient.model.IImageStream)13 Test (org.junit.Test)8 DockerImageURI (com.openshift.restclient.images.DockerImageURI)4 IProject (com.openshift.restclient.model.IProject)3 IResource (com.openshift.restclient.model.IResource)3 Connection (org.jboss.tools.openshift.core.connection.Connection)3 IResourceFactory (com.openshift.restclient.IResourceFactory)2 ResourceKind (com.openshift.restclient.ResourceKind)2 IDeploymentConfig (com.openshift.restclient.model.IDeploymentConfig)2 IDeploymentImageChangeTrigger (com.openshift.restclient.model.deploy.IDeploymentImageChangeTrigger)2 ArrayList (java.util.ArrayList)2 Collection (java.util.Collection)2 Collections (java.util.Collections)2 List (java.util.List)2 IStatus (org.eclipse.core.runtime.IStatus)2 ICommonAttributes (org.jboss.tools.openshift.core.ICommonAttributes)2 ResourceMocks.createConnection (org.jboss.tools.openshift.test.util.ResourceMocks.createConnection)2 ResourceFactory (com.openshift.internal.restclient.ResourceFactory)1 IClient (com.openshift.restclient.IClient)1 OpenShiftException (com.openshift.restclient.OpenShiftException)1