use of org.eclipse.jkube.gradle.plugin.TestOpenShiftExtension in project jkube by eclipse.
the class OpenShiftHelmTaskTest method setUp.
@Before
public void setUp() {
extension = new TestOpenShiftExtension();
helmServiceMockedConstruction = mockConstruction(HelmService.class);
when(taskEnvironment.project.getExtensions().getByType(OpenShiftExtension.class)).thenReturn(extension);
}
use of org.eclipse.jkube.gradle.plugin.TestOpenShiftExtension in project jkube by eclipse.
the class OpenShiftUndeployTaskTest method setUp.
@Before
public void setUp() {
clusterAccessMockedConstruction = mockConstruction(ClusterAccess.class, (mock, ctx) -> {
final OpenShiftClient openShiftClient = mock(OpenShiftClient.class);
when(mock.createDefaultClient()).thenReturn(openShiftClient);
when(openShiftClient.isAdaptable(OpenShiftClient.class)).thenReturn(true);
});
openshiftUndeployServiceMockedConstruction = mockConstruction(OpenshiftUndeployService.class);
extension = new TestOpenShiftExtension();
when(taskEnvironment.project.getExtensions().getByType(OpenShiftExtension.class)).thenReturn(extension);
when(taskEnvironment.project.getName()).thenReturn("test-project");
}
use of org.eclipse.jkube.gradle.plugin.TestOpenShiftExtension in project jkube by eclipse.
the class OpenShiftWatchTaskTest method setUp.
@Before
public void setUp() throws IOException {
clusterAccessMockedConstruction = mockConstruction(ClusterAccess.class, (mock, ctx) -> {
final OpenShiftClient openShiftClient = mock(OpenShiftClient.class);
when(openShiftClient.getMasterUrl()).thenReturn(new URL("http://openshiftapps.com:6443"));
when(mock.createDefaultClient()).thenReturn(openShiftClient);
});
watcherManagerMockedStatic = mockStatic(WatcherManager.class);
kubernetesHelperMockedStatic = mockStatic(KubernetesHelper.class);
extension = new TestOpenShiftExtension();
when(taskEnvironment.project.getExtensions().getByType(OpenShiftExtension.class)).thenReturn(extension);
kubernetesHelperMockedStatic.when(KubernetesHelper::getDefaultNamespace).thenReturn(null);
extension.isFailOnNoKubernetesJson = false;
}
use of org.eclipse.jkube.gradle.plugin.TestOpenShiftExtension in project jkube by eclipse.
the class OpenShiftApplyTaskTest method setUp.
@Before
public void setUp() {
clusterAccessMockedConstruction = mockConstruction(ClusterAccess.class, (mock, ctx) -> {
final OpenShiftClient openShiftClient = mock(OpenShiftClient.class);
when(openShiftClient.getMasterUrl()).thenReturn(new URL("http://openshiftapps-com-cluster:6443"));
when(openShiftClient.isAdaptable(OpenShiftClient.class)).thenReturn(true);
when(mock.createDefaultClient()).thenReturn(openShiftClient);
});
applyServiceMockedConstruction = mockConstruction(ApplyService.class);
extension = new TestOpenShiftExtension();
when(taskEnvironment.project.getExtensions().getByType(OpenShiftExtension.class)).thenReturn(extension);
extension.isFailOnNoKubernetesJson = false;
}
use of org.eclipse.jkube.gradle.plugin.TestOpenShiftExtension 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());
}
Aggregations