Search in sources :

Example 1 with KubernetesExtension

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

the class KubernetesResourceTaskTest method runTask_withSkipResource_shouldDoNothing.

@Test
public void runTask_withSkipResource_shouldDoNothing() {
    // Given
    KubernetesExtension extension = new TestKubernetesExtension() {

        @Override
        public Property<Boolean> getSkipResource() {
            return new DefaultProperty<>(Boolean.class).value(true);
        }
    };
    when(taskEnvironment.project.getExtensions().getByType(KubernetesExtension.class)).thenReturn(extension);
    final KubernetesResourceTask kubernetesResourceTask = new KubernetesResourceTask(KubernetesExtension.class);
    // When
    kubernetesResourceTask.runTask();
    // Then
    assertThat(taskEnvironment.getRoot().toPath().resolve("build").resolve("jkube")).doesNotExist();
}
Also used : KubernetesExtension(org.eclipse.jkube.gradle.plugin.KubernetesExtension) TestKubernetesExtension(org.eclipse.jkube.gradle.plugin.TestKubernetesExtension) TestKubernetesExtension(org.eclipse.jkube.gradle.plugin.TestKubernetesExtension) Test(org.junit.Test)

Aggregations

KubernetesExtension (org.eclipse.jkube.gradle.plugin.KubernetesExtension)1 TestKubernetesExtension (org.eclipse.jkube.gradle.plugin.TestKubernetesExtension)1 Test (org.junit.Test)1