From 67018d523a0e14c7dedf208619faf4017c8143ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Henning?= <soeren.henning@email.uni-kiel.de> Date: Mon, 14 Mar 2022 13:53:46 +0100 Subject: [PATCH] Cleanup code --- .../src/main/kotlin/theodolite/util/YamlParserFromFile.kt | 1 + .../src/main/kotlin/theodolite/util/YamlParserFromString.kt | 1 + .../kotlin/theodolite/benchmark/ConfigMapResourceSetTest.kt | 2 ++ theodolite/src/test/kotlin/theodolite/k8s/K8sManagerTest.kt | 5 +---- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/theodolite/src/main/kotlin/theodolite/util/YamlParserFromFile.kt b/theodolite/src/main/kotlin/theodolite/util/YamlParserFromFile.kt index ae36349e6..58ca925e6 100644 --- a/theodolite/src/main/kotlin/theodolite/util/YamlParserFromFile.kt +++ b/theodolite/src/main/kotlin/theodolite/util/YamlParserFromFile.kt @@ -9,6 +9,7 @@ import java.io.InputStream /** * The YamlParser parses a YAML file */ +@Deprecated("Use Jackson ObjectMapper instead") class YamlParserFromFile : Parser { override fun <T> parse(path: String, E: Class<T>): T? { val input: InputStream = FileInputStream(File(path)) diff --git a/theodolite/src/main/kotlin/theodolite/util/YamlParserFromString.kt b/theodolite/src/main/kotlin/theodolite/util/YamlParserFromString.kt index 0e197908a..99c81f1ed 100644 --- a/theodolite/src/main/kotlin/theodolite/util/YamlParserFromString.kt +++ b/theodolite/src/main/kotlin/theodolite/util/YamlParserFromString.kt @@ -6,6 +6,7 @@ import org.yaml.snakeyaml.constructor.Constructor /** * The YamlParser parses a YAML string */ +@Deprecated("Use Jackson ObjectMapper instead") class YamlParserFromString : Parser { override fun <T> parse(fileString: String, E: Class<T>): T? { val parser = Yaml(Constructor(E)) diff --git a/theodolite/src/test/kotlin/theodolite/benchmark/ConfigMapResourceSetTest.kt b/theodolite/src/test/kotlin/theodolite/benchmark/ConfigMapResourceSetTest.kt index eb213370b..33a4572e3 100644 --- a/theodolite/src/test/kotlin/theodolite/benchmark/ConfigMapResourceSetTest.kt +++ b/theodolite/src/test/kotlin/theodolite/benchmark/ConfigMapResourceSetTest.kt @@ -159,6 +159,8 @@ internal class ConfigMapResourceSetTest { val loadedResource = createdResource.toList().first().second assertTrue(loadedResource is ExecutionCRD) assertEquals("example-execution", loadedResource.metadata.name) + + } @Test diff --git a/theodolite/src/test/kotlin/theodolite/k8s/K8sManagerTest.kt b/theodolite/src/test/kotlin/theodolite/k8s/K8sManagerTest.kt index 2ea60c949..dca826474 100644 --- a/theodolite/src/test/kotlin/theodolite/k8s/K8sManagerTest.kt +++ b/theodolite/src/test/kotlin/theodolite/k8s/K8sManagerTest.kt @@ -1,6 +1,5 @@ package theodolite.k8s -import com.fasterxml.jackson.annotation.JsonIgnoreProperties import io.fabric8.kubernetes.api.model.* import io.fabric8.kubernetes.api.model.apps.Deployment import io.fabric8.kubernetes.api.model.apps.DeploymentBuilder @@ -11,9 +10,7 @@ import io.fabric8.kubernetes.client.server.mock.KubernetesServer import io.quarkus.test.junit.QuarkusTest import io.quarkus.test.kubernetes.client.KubernetesTestServer import io.quarkus.test.kubernetes.client.WithKubernetesTestServer -import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test import registerResource @@ -21,7 +18,7 @@ import registerResource @QuarkusTest @WithKubernetesTestServer -class K8sManagerTest { +internal class K8sManagerTest { @KubernetesTestServer private lateinit var server: KubernetesServer -- GitLab