From aeb30112e5a3007d39f523513e7dc700079c7ef8 Mon Sep 17 00:00:00 2001
From: "stu126940@mail.uni-kiel.de" <stu126940@mail.uni-kiel.de>
Date: Mon, 22 Nov 2021 15:40:30 +0100
Subject: [PATCH] fix test

---
 .../theodolite/execution/operator/TheodoliteController.kt  | 4 ++--
 .../kotlin/theodolite/execution/operator/ControllerTest.kt | 7 +++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt b/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt
index 0226911c9..1cfc037f6 100644
--- a/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt
+++ b/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt
@@ -191,9 +191,9 @@ class TheodoliteController(
     private fun checkResource(benchmark: KubernetesBenchmark): States {
         return try {
             val appResources =
-                benchmark.loadKubernetesResources(resources = benchmark.appResource)
+                benchmark.loadKubernetesResources(resourceSet = benchmark.appResourceSets)
             val loadGenResources =
-                benchmark.loadKubernetesResources(resources = benchmark.loadGenResource)
+                benchmark.loadKubernetesResources(resourceSet = benchmark.loadGenResourceSets)
             if(appResources.isNotEmpty() && loadGenResources.isNotEmpty()) {
                 States.AVAILABLE
             } else {
diff --git a/theodolite/src/test/kotlin/theodolite/execution/operator/ControllerTest.kt b/theodolite/src/test/kotlin/theodolite/execution/operator/ControllerTest.kt
index b0b72fe4b..62a5327d9 100644
--- a/theodolite/src/test/kotlin/theodolite/execution/operator/ControllerTest.kt
+++ b/theodolite/src/test/kotlin/theodolite/execution/operator/ControllerTest.kt
@@ -15,6 +15,8 @@ import theodolite.benchmark.BenchmarkExecution
 import theodolite.benchmark.KubernetesBenchmark
 import theodolite.model.crd.BenchmarkCRD
 import theodolite.model.crd.ExecutionCRD
+import theodolite.model.crd.ExecutionStatus
+import theodolite.model.crd.States
 
 @QuarkusTest
 class ControllerTest {
@@ -40,6 +42,7 @@ class ControllerTest {
 
         // benchmark
         val benchmark1 = BenchmarkCRDummy(name = "Test-Benchmark")
+        benchmark1.getCR().status.resourceSets = States.AVAILABLE.value
         val benchmark2 = BenchmarkCRDummy(name = "Test-Benchmark-123")
         benchmarkResourceList.items = listOf(benchmark1.getCR(), benchmark2.getCR())
 
@@ -113,12 +116,12 @@ class ControllerTest {
             .getDeclaredMethod("getBenchmarks")
         method.isAccessible = true
 
-        val result = method.invoke(controller) as List<KubernetesBenchmark>
+        val result = method.invoke(controller) as List<BenchmarkCRD>
 
         assertEquals(2, result.size)
         assertEquals(
             gson.toJson(benchmark),
-            gson.toJson(result.firstOrNull())
+            gson.toJson(result.firstOrNull()?.spec)
         )
     }
 
-- 
GitLab