use of org.gradle.api.internal.provider.DefaultProperty in project jkube by eclipse.
the class KubernetesPushTaskTest method runTask_withSkipPush_shouldDoNothing.
@Test
public void runTask_withSkipPush_shouldDoNothing() throws JKubeServiceException {
// Given
extension = new TestKubernetesExtension() {
@Override
public Property<Boolean> getSkipPush() {
return new DefaultProperty<>(Boolean.class).value(true);
}
};
when(taskEnvironment.project.getExtensions().getByType(KubernetesExtension.class)).thenReturn(extension);
final KubernetesPushTask pushTask = new KubernetesPushTask(KubernetesExtension.class);
when(pushTask.getName()).thenReturn("k8sPush");
// When
pushTask.runTask();
// Then
Assertions.assertThat(dockerBuildServiceMockedConstruction.constructed()).isEmpty();
verify(pushTask.jKubeServiceHub.getBuildService(), times(0)).push(any(), anyInt(), any(), anyBoolean());
verify(taskEnvironment.logger, times(1)).lifecycle(contains("k8s: `k8sPush` task is skipped."));
}
use of org.gradle.api.internal.provider.DefaultProperty in project jkube by eclipse.
the class KubernetesApplyTaskTest method runTask_withSkipApply_shouldDoNothing.
@Test
public void runTask_withSkipApply_shouldDoNothing() {
// Given
extension = new TestKubernetesExtension() {
@Override
public Property<Boolean> getSkipApply() {
return new DefaultProperty<>(Boolean.class).value(true);
}
};
when(taskEnvironment.project.getExtensions().getByType(KubernetesExtension.class)).thenReturn(extension);
final KubernetesApplyTask applyTask = new KubernetesApplyTask(KubernetesExtension.class);
// When
applyTask.runTask();
// Then
assertThat(applyServiceMockedConstruction.constructed()).isEmpty();
}
use of org.gradle.api.internal.provider.DefaultProperty in project jkube by eclipse.
the class KubernetesBuildTaskTest method runTask_withSkipBuild_shouldDoNothing.
@Test
public void runTask_withSkipBuild_shouldDoNothing() throws JKubeServiceException {
// Given
extension = new TestKubernetesExtension() {
@Override
public Property<Boolean> getSkipBuild() {
return new DefaultProperty<>(Boolean.class).value(true);
}
};
when(taskEnvironment.project.getExtensions().getByType(KubernetesExtension.class)).thenReturn(extension);
final KubernetesBuildTask buildTask = new KubernetesBuildTask(KubernetesExtension.class);
// When
buildTask.runTask();
// Then
Assertions.assertThat(dockerBuildServiceMockedConstruction.constructed()).isEmpty();
verify(buildTask.jKubeServiceHub.getBuildService(), times(0)).build(any());
}
Aggregations