From e36c70c6efe75a6fe7f390e46726f3efa7ab51b2 Mon Sep 17 00:00:00 2001
From: "stu126940@mail.uni-kiel.de" <stu126940@mail.uni-kiel.de>
Date: Mon, 15 Mar 2021 20:38:00 +0100
Subject: [PATCH] Clean up

---
 .../theodolite/benchmark/KubernetesBenchmark.kt     | 13 ++++---------
 .../kotlin/theodolite/ResourceLimitPatcherTest.kt   |  1 -
 .../kotlin/theodolite/ResourceRequestPatcherTest.kt |  1 -
 3 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt
index 995f35e26..0110e1d7c 100644
--- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt
+++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt
@@ -45,17 +45,12 @@ class KubernetesBenchmark : Benchmark {
         val resources = loadKubernetesResources(this.appResource + this.loadGenResource)
         val patcherFactory = PatcherFactory()
 
-        // patch the load dimension
-        load.getType().map { patcherDefinition -> patcherFactory.createPatcher(patcherDefinition, resources) }
-            .forEach { patcher -> patcher.patch(load.get().toString()) }
-
-        // patch the resources
-        res.getType().map { patcherDefinition -> patcherFactory.createPatcher(patcherDefinition, resources) }
-            .forEach { patcher -> patcher.patch(res.get().toString()) }
+        // patch the load dimension the resources
+        load.getType().forEach { patcherDefinition -> patcherFactory.createPatcher(patcherDefinition, resources).patch(load.get().toString()) }
+        res.getType().forEach{ patcherDefinition -> patcherFactory.createPatcher(patcherDefinition, resources).patch(res.get().toString()) }
 
         // Patch the given overrides
-        configurationOverrides.forEach { override ->
-          patcherFactory.createPatcher(override.patcher, resources).patch(override.value) }
+        configurationOverrides.forEach { override -> patcherFactory.createPatcher(override.patcher, resources).patch(override.value) }
 
 
         return KubernetesBenchmarkDeployment(
diff --git a/theodolite-quarkus/src/test/kotlin/theodolite/ResourceLimitPatcherTest.kt b/theodolite-quarkus/src/test/kotlin/theodolite/ResourceLimitPatcherTest.kt
index 79d6efe47..82e4bc5d7 100644
--- a/theodolite-quarkus/src/test/kotlin/theodolite/ResourceLimitPatcherTest.kt
+++ b/theodolite-quarkus/src/test/kotlin/theodolite/ResourceLimitPatcherTest.kt
@@ -53,7 +53,6 @@ class ResourceLimitPatcherTest {
 
         k8sResource.spec.template.spec.containers.filter { it.name == defCPU.container }
             .forEach {
-                println(it)
                 assertTrue(it.resources.limits["cpu"].toString() == cpuValue)
                 assertTrue(it.resources.limits["memory"].toString() == memValue)
             }
diff --git a/theodolite-quarkus/src/test/kotlin/theodolite/ResourceRequestPatcherTest.kt b/theodolite-quarkus/src/test/kotlin/theodolite/ResourceRequestPatcherTest.kt
index 9ca9a83aa..3cd6b012f 100644
--- a/theodolite-quarkus/src/test/kotlin/theodolite/ResourceRequestPatcherTest.kt
+++ b/theodolite-quarkus/src/test/kotlin/theodolite/ResourceRequestPatcherTest.kt
@@ -53,7 +53,6 @@ class ResourceRequestPatcherTest {
 
         k8sResource.spec.template.spec.containers.filter { it.name == defCPU.container }
             .forEach {
-                println(it)
                 assertTrue(it.resources.requests["cpu"].toString() == cpuValue)
                 assertTrue(it.resources.requests["memory"].toString() == memValue)
             }
-- 
GitLab