From 18e355d76b3db7e6b506d216dbd8237736edfca6 Mon Sep 17 00:00:00 2001 From: ejblanco Date: Wed, 23 Oct 2024 11:16:19 +0200 Subject: [PATCH] fix utests --- .../org/apache/spark/deploy/k8s/submit/ClientSuite.scala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/submit/ClientSuite.scala b/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/submit/ClientSuite.scala index d31dac82c4152..3b8d5209b142e 100644 --- a/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/submit/ClientSuite.scala +++ b/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/submit/ClientSuite.scala @@ -19,15 +19,19 @@ package org.apache.spark.deploy.k8s.submit import java.io.File import java.nio.charset.StandardCharsets import java.nio.file.Files + import scala.collection.JavaConverters._ + import io.fabric8.kubernetes.api.model._ import io.fabric8.kubernetes.api.model.apiextensions.v1.{CustomResourceDefinition, CustomResourceDefinitionBuilder} import io.fabric8.kubernetes.client.{KubernetesClient, Watch} import io.fabric8.kubernetes.client.dsl.PodResource import org.mockito.{ArgumentCaptor, Mock, MockitoAnnotations} import org.mockito.Mockito.{verify, when} +import org.mockito.MockitoSugar.withObjectSpied import org.scalatest.BeforeAndAfter import org.scalatestplus.mockito.MockitoSugar._ + import org.apache.spark.{SparkConf, SparkFunSuite} import org.apache.spark.deploy.k8s.{Config, _} import org.apache.spark.deploy.k8s.Config.WAIT_FOR_APP_COMPLETION @@ -35,7 +39,6 @@ import org.apache.spark.deploy.k8s.Constants._ import org.apache.spark.deploy.k8s.Fabric8Aliases._ import org.apache.spark.deploy.k8s.submit.Client.submissionId import org.apache.spark.util.Utils -import org.mockito.MockitoSugar.withObjectSpied class ClientSuite extends SparkFunSuite with BeforeAndAfter { @@ -334,7 +337,8 @@ class ClientSuite extends SparkFunSuite with BeforeAndAfter { resourceNamePrefix = Some(KUBERNETES_RESOURCE_PREFIX)) assert(kconf.sparkConf.getOption("spark.home").isDefined) - when(driverBuilder.buildFromFeatures(kconf, kubernetesClient)).thenReturn(BUILT_KUBERNETES_SPEC) + when(driverBuilder.buildFromFeatures(kconf, kubernetesClient)) + .thenReturn(BUILT_KUBERNETES_SPEC) val submissionClient = new Client( kconf,