Search in sources :

Example 1 with OpenShiftExtension

use of org.eclipse.jkube.gradle.plugin.OpenShiftExtension in project jkube by eclipse.

the class OpenShiftBuildTaskTest method setUp.

@Before
public void setUp() {
    openshiftBuildServiceMockedConstruction = mockConstruction(OpenshiftBuildService.class, (mock, ctx) -> when(mock.isApplicable()).thenReturn(true));
    final OpenShiftExtension extension = new TestOpenShiftExtension();
    when(taskEnvironment.project.getExtensions().getByType(OpenShiftExtension.class)).thenReturn(extension);
    extension.images = Collections.singletonList(ImageConfiguration.builder().name("foo/bar:latest").build(BuildConfiguration.builder().dockerFile("Dockerfile").build()).build());
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) OpenshiftBuildService(org.eclipse.jkube.kit.config.service.openshift.OpenshiftBuildService) BuildConfiguration(org.eclipse.jkube.kit.config.image.build.BuildConfiguration) ImageConfiguration(org.eclipse.jkube.kit.config.image.ImageConfiguration) Test(org.junit.Test) Mockito.times(org.mockito.Mockito.times) OpenShiftExtension(org.eclipse.jkube.gradle.plugin.OpenShiftExtension) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) TestOpenShiftExtension(org.eclipse.jkube.gradle.plugin.TestOpenShiftExtension) Rule(org.junit.Rule) After(org.junit.After) Mockito.mockConstruction(org.mockito.Mockito.mockConstruction) JKubeServiceException(org.eclipse.jkube.kit.config.service.JKubeServiceException) Collections(java.util.Collections) AssertionsForClassTypes.assertThat(org.assertj.core.api.AssertionsForClassTypes.assertThat) Before(org.junit.Before) MockedConstruction(org.mockito.MockedConstruction) OpenshiftBuildService(org.eclipse.jkube.kit.config.service.openshift.OpenshiftBuildService) OpenShiftExtension(org.eclipse.jkube.gradle.plugin.OpenShiftExtension) TestOpenShiftExtension(org.eclipse.jkube.gradle.plugin.TestOpenShiftExtension) TestOpenShiftExtension(org.eclipse.jkube.gradle.plugin.TestOpenShiftExtension) Before(org.junit.Before)

Aggregations

Collections (java.util.Collections)1 AssertionsForClassTypes.assertThat (org.assertj.core.api.AssertionsForClassTypes.assertThat)1 OpenShiftExtension (org.eclipse.jkube.gradle.plugin.OpenShiftExtension)1 TestOpenShiftExtension (org.eclipse.jkube.gradle.plugin.TestOpenShiftExtension)1 ImageConfiguration (org.eclipse.jkube.kit.config.image.ImageConfiguration)1 BuildConfiguration (org.eclipse.jkube.kit.config.image.build.BuildConfiguration)1 JKubeServiceException (org.eclipse.jkube.kit.config.service.JKubeServiceException)1 OpenshiftBuildService (org.eclipse.jkube.kit.config.service.openshift.OpenshiftBuildService)1 After (org.junit.After)1 Before (org.junit.Before)1 Rule (org.junit.Rule)1 Test (org.junit.Test)1 ArgumentMatchers.any (org.mockito.ArgumentMatchers.any)1 MockedConstruction (org.mockito.MockedConstruction)1 Mockito.mockConstruction (org.mockito.Mockito.mockConstruction)1 Mockito.times (org.mockito.Mockito.times)1 Mockito.verify (org.mockito.Mockito.verify)1 Mockito.when (org.mockito.Mockito.when)1