Prepare Mock for EnrichmentController 38/4838/3
authorecaiyanlinux <martin.c.yan@est.tech>
Tue, 13 Oct 2020 12:22:46 +0000 (14:22 +0200)
committerecaiyanlinux <martin.c.yan@est.tech>
Wed, 14 Oct 2020 06:59:43 +0000 (08:59 +0200)
Signed-off-by: ecaiyanlinux <martin.c.yan@est.tech>
Issue-ID: NONRTRIC-296
Change-Id: I9b954652c0737269aaf03cf6722924d7175f65e6

17 files changed:
webapp-backend/src/main/java/org/oransc/portal/nonrtric/controlpanel/config/WebSecurityConfiguration.java
webapp-backend/src/main/java/org/oransc/portal/nonrtric/controlpanel/controller/EnrichmentController.java
webapp-backend/src/main/java/org/oransc/portal/nonrtric/controlpanel/eiproducerapi/EiProducerApiImpl.java
webapp-backend/src/main/resources/application.properties
webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiJob.java [new file with mode: 0644]
webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiJobs.java [new file with mode: 0644]
webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiProducer.java [new file with mode: 0644]
webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiProducers.java [new file with mode: 0644]
webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiType.java [new file with mode: 0644]
webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiTypes.java [new file with mode: 0644]
webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EnrichmentControllerMockConfiguration.java [new file with mode: 0644]
webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/PolicyControllerMockConfiguration.java [moved from webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/config/PolicyControllerMockConfiguration.java with 99% similarity]
webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/PortalApIMockConfiguration.java [moved from webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/config/PortalApIMockConfiguration.java with 98% similarity]
webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/WebSecurityMockConfiguration.java [moved from webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/config/WebSecurityMockConfiguration.java with 96% similarity]
webapp-backend/src/test/resources/ei-type-1.json [new file with mode: 0644]
webapp-backend/src/test/resources/ei-type-2.json [new file with mode: 0644]
webapp-backend/src/test/resources/job-1.json [new file with mode: 0644]

index d8c2b94..88751b9 100644 (file)
@@ -86,7 +86,7 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
      * Swagger-generated documentation.
      */
     @SuppressWarnings("squid:S1075") // URIs should not be hardcoded
-    protected static final String[] OPEN_PATHS = { //
+    public static final String[] OPEN_PATHS = { //
         "/v2/api-docs", //
         "/swagger-resources/**", //
         "/swagger-ui.html", //
index 558923f..300def5 100644 (file)
  */
 package org.oransc.portal.nonrtric.controlpanel.controller;
 
+import io.swagger.annotations.ApiOperation;
+
 import java.lang.invoke.MethodHandles;
+
 import org.oransc.portal.nonrtric.controlpanel.ControlPanelConstants;
 import org.oransc.portal.nonrtric.controlpanel.eiproducerapi.EiProducerApi;
 import org.slf4j.Logger;
@@ -33,7 +36,6 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
-import io.swagger.annotations.ApiOperation;
 
 /**
  * Proxies calls from the front end to the EI Producer API.
@@ -120,4 +122,4 @@ public class EnrichmentController {
         logger.debug("getEiProducerStatus {}", eiProducerId);
         return this.eiProducerApi.getEiProducerStatus(eiProducerId);
     }
-}
\ No newline at end of file
+}
index ca45e27..3ce3cc0 100644 (file)
 package org.oransc.portal.nonrtric.controlpanel.eiproducerapi;
 
 import com.google.gson.GsonBuilder;
+
 import java.lang.invoke.MethodHandles;
+
 import javax.net.ssl.SSLException;
+
 import org.json.JSONArray;
 import org.json.JSONObject;
 import org.oransc.portal.nonrtric.controlpanel.util.AsyncRestClient;
index 6533651..e795dca 100644 (file)
@@ -56,7 +56,7 @@ policycontroller.url.prefix = http://policy-agent-container:8081
 
 # URL for enrichment coordinator service
 # enrichmentcontroller.url.prefix = https://enrichment-service-container:8434
-enrichmentcontroller.url.prefix = http://enrichment-service-container:8082/ei-producer/v1
+enrichmentcontroller.url.prefix = http://enrichment-service-container:8083/ei-producer/v1
 
 # Mimic slow endpoints by defining sleep period, in milliseconds
 mock.config.delay = 0
diff --git a/webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiJob.java b/webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiJob.java
new file mode 100644 (file)
index 0000000..56d3fc8
--- /dev/null
@@ -0,0 +1,42 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 Nordix Foundation
+ * Modifications Copyright (C) 2020 Nordix Foundation
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+package org.oransc.portal.nonrtric.controlpanel.mock;
+
+import org.immutables.gson.Gson;
+import org.immutables.value.Value;
+
+@Value.Immutable
+@Gson.TypeAdapters
+public interface EiJob {
+
+    public String ei_job_identity();
+
+    public String target_uri();
+
+    public Object ei_job_data();
+
+    public String ei_type_identity();
+
+    public String owner();
+
+    public String status();
+
+}
diff --git a/webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiJobs.java b/webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiJobs.java
new file mode 100644 (file)
index 0000000..0a486ec
--- /dev/null
@@ -0,0 +1,29 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 Nordix Foundation
+ * Modifications Copyright (C) 2020 Nordix Foundation
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+package org.oransc.portal.nonrtric.controlpanel.mock;
+
+import java.util.ArrayList;
+
+public class EiJobs extends ArrayList<EiJob> {
+
+    private static final long serialVersionUID = -928428052502491021L;
+
+}
diff --git a/webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiProducer.java b/webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiProducer.java
new file mode 100644 (file)
index 0000000..01bcee8
--- /dev/null
@@ -0,0 +1,43 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 Nordix Foundation
+ * Modifications Copyright (C) 2020 Nordix Foundation
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+package org.oransc.portal.nonrtric.controlpanel.mock;
+
+import java.util.List;
+
+import org.immutables.gson.Gson;
+import org.immutables.value.Value;
+
+@Value.Immutable
+@Gson.TypeAdapters
+public interface EiProducer {
+
+    public String ei_producer_id();
+
+    public String ei_job_creation_callback_url();
+
+    public String ei_job_deletion_callback_url();
+
+    public String ei_producer_supervision_callback_url();
+
+    public List<EiType> supported_ei_types();
+
+    public String status();
+}
diff --git a/webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiProducers.java b/webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiProducers.java
new file mode 100644 (file)
index 0000000..5bc3ec8
--- /dev/null
@@ -0,0 +1,29 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 Nordix Foundation
+ * Modifications Copyright (C) 2020 Nordix Foundation
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+package org.oransc.portal.nonrtric.controlpanel.mock;
+
+import java.util.ArrayList;
+
+public class EiProducers extends ArrayList<EiProducer> {
+
+    private static final long serialVersionUID = -928428052502491021L;
+
+}
diff --git a/webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiType.java b/webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiType.java
new file mode 100644 (file)
index 0000000..ce64fad
--- /dev/null
@@ -0,0 +1,37 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 Nordix Foundation
+ * Modifications Copyright (C) 2020 Nordix Foundation
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+package org.oransc.portal.nonrtric.controlpanel.mock;
+
+import java.util.List;
+
+import org.immutables.gson.Gson;
+import org.immutables.value.Value;
+
+@Value.Immutable
+@Gson.TypeAdapters
+public interface EiType {
+
+    public String ei_type_identity();
+
+    public Object ei_job_data_schema();
+
+    public List<String> ei_producer_ids();
+}
diff --git a/webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiTypes.java b/webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EiTypes.java
new file mode 100644 (file)
index 0000000..8fc9eaf
--- /dev/null
@@ -0,0 +1,29 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 Nordix Foundation
+ * Modifications Copyright (C) 2020 Nordix Foundation
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+package org.oransc.portal.nonrtric.controlpanel.mock;
+
+import java.util.ArrayList;
+
+public class EiTypes extends ArrayList<EiType> {
+
+    private static final long serialVersionUID = -928428052502491021L;
+
+}
diff --git a/webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EnrichmentControllerMockConfiguration.java b/webapp-backend/src/test/java/org/oransc/portal/nonrtric/controlpanel/mock/EnrichmentControllerMockConfiguration.java
new file mode 100644 (file)
index 0000000..626f0c4
--- /dev/null
@@ -0,0 +1,280 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 Nordix Foundation
+ * Modifications Copyright (C) 2020 Nordix Foundation
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+package org.oransc.portal.nonrtric.controlpanel.mock;
+
+import com.google.gson.GsonBuilder;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.invoke.MethodHandles;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import org.oransc.portal.nonrtric.controlpanel.eiproducerapi.EiProducerApi;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.test.context.TestConfiguration;
+import org.springframework.context.annotation.Bean;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.client.RestClientException;
+
+/**
+ * Creates a mock implementation of the policy controller client API.
+ */
+@TestConfiguration
+public class EnrichmentControllerMockConfiguration {
+
+    private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+    private static com.google.gson.Gson gson = new GsonBuilder() //
+        .serializeNulls() //
+        .create(); //
+
+    @Bean
+    public EiProducerApi eiProducerApi() {
+        MockEiProducerApi apiClient = new MockEiProducerApi();
+        return apiClient;
+    }
+
+    class MockEiProducerApi implements EiProducerApi {
+        private final Database database = new Database();
+
+        @Override
+        public ResponseEntity<String> getAllEiTypeIds() {
+            List<String> result = new ArrayList<>();
+            result.addAll(database.getAllEiTypeIds());
+            return new ResponseEntity<>(gson.toJson(result), HttpStatus.OK);
+        }
+
+        public ResponseEntity<String> getAllEiTypes() {
+            EiTypes result = new EiTypes();
+            result.addAll(database.getAllEiTypes());
+            return new ResponseEntity<>(gson.toJson(result), HttpStatus.OK);
+        }
+
+        @Override
+        public ResponseEntity<String> getEiType(String eiTypeId) {
+            EiType result = database.getEiTypeInstance(eiTypeId);
+            return new ResponseEntity<>(gson.toJson(result), HttpStatus.OK);
+        }
+
+        @Override
+        public ResponseEntity<String> getAllEiProducerIds() {
+            List<String> result = new ArrayList<>();
+            result.addAll(database.getAllEiProducerIds());
+            return new ResponseEntity<>(gson.toJson(result), HttpStatus.OK);
+        }
+
+        public ResponseEntity<String> getAllEiProducers() {
+            EiProducers result = new EiProducers();
+            result.addAll(database.getAllEiProducers());
+            return new ResponseEntity<>(gson.toJson(result), HttpStatus.OK);
+        }
+
+        @Override
+        public ResponseEntity<String> getEiProducer(String eiProducerId) {
+            EiProducer result = database.getEiProducerInstance(eiProducerId);
+            return new ResponseEntity<>(gson.toJson(result), HttpStatus.OK);
+        }
+
+        @Override
+        public ResponseEntity<String> getEiJobsForOneEiProducer(String eiProducerId) {
+            EiJobs result = new EiJobs();
+            List<EiJob> inst = database.getEiJobsForOneEiProducer(Optional.of(eiProducerId));
+            result.addAll(inst);
+            return new ResponseEntity<>(gson.toJson(result), HttpStatus.OK);
+        }
+
+        @Override
+        public ResponseEntity<String> getEiProducerStatus(String eiProducerId) {
+            EiProducer result = database.getEiProducerInstance(eiProducerId);
+            return new ResponseEntity<>(gson.toJson(result.status()), HttpStatus.OK);
+        }
+
+        public ResponseEntity<String> deleteEiProducerInstance(String eiProducerId) {
+            database.deleteEiProducerInstance(eiProducerId);
+            return new ResponseEntity<>(HttpStatus.OK);
+        }
+
+        public ResponseEntity<String> deleteEiTypeInstance(String eiTypeId) {
+            database.deleteEiTypeInstance(eiTypeId);
+            return new ResponseEntity<>(HttpStatus.OK);
+        }
+
+        public ResponseEntity<String> deleteEiJobInstance(String eiJobId) {
+            database.deleteEiJobInstance(eiJobId);
+            return new ResponseEntity<>(HttpStatus.OK);
+        }
+    }
+
+    class Database {
+
+        Database() {
+
+            List<EiType> supported_types = new ArrayList<EiType>();
+
+            // Create EiType instance
+            String schema = getStringFromFile("ei-type-1.json");
+            EiType eiType1 = putEiTypeInstance("type1", schema, Arrays.asList("prod-1"));
+            supported_types.add(eiType1);
+
+            // Create EiType instance
+            schema = getStringFromFile("ei-type-2.json");
+            EiType eiType2 = putEiTypeInstance("type2", schema, Arrays.asList("prod-1"));
+            supported_types.add(eiType2);
+
+            // Create EiProducer instance
+            putEiProducerInstance("prod-1", "http://example.com/", "http://example.com/", "http://example.com/",
+                supported_types, "ENABLED");
+
+            // Create EiJob instance
+            schema = getStringFromFile("job-1.json");
+            putEiJobInstance("type1", "job1", schema, "prod-1", "http://example.com/");
+        }
+
+        private String getStringFromFile(String path) {
+            try {
+                InputStream inputStream =
+                    MethodHandles.lookup().lookupClass().getClassLoader().getResourceAsStream(path);
+                return new BufferedReader(new InputStreamReader(inputStream)).lines().collect(Collectors.joining("\n"));
+            } catch (Exception e) {
+                logger.error("Cannot read file :" + path, e);
+                return "";
+            }
+        }
+
+        String normalize(String str) {
+            return str.replace('\n', ' ');
+        }
+
+        void putEiJobInstance(String typeId, String instanceId, Object instanceData, String owner, String targetUrl) {
+            EiJob i = ImmutableEiJob.builder() //
+                .ei_job_data(instanceData) //
+                .ei_job_identity(instanceId) //
+                .owner(owner) //
+                .ei_type_identity(typeId) //
+                .target_uri(targetUrl) //
+                .status("ENABLED") //
+                .build(); //
+            eiJobs.put(instanceId, i);
+        }
+
+        void putEiProducerInstance(String id, String creation_url, String deletion_url, String callback_url,
+            List<EiType> supported_types, String status) {
+            EiProducer eiProducer = ImmutableEiProducer.builder() //
+                .ei_producer_id(id) //
+                .ei_job_creation_callback_url(creation_url) //
+                .ei_job_deletion_callback_url(deletion_url) //
+                .ei_producer_supervision_callback_url(callback_url) //
+                .supported_ei_types(supported_types) //
+                .status(status).build(); //
+            eiProducers.put(id, eiProducer);
+        }
+
+        EiType putEiTypeInstance(String id, Object data, List<String> producer_ids) {
+            EiType i = ImmutableEiType.builder() //
+                .ei_type_identity(id) //
+                .ei_job_data_schema(data) //
+                .ei_producer_ids(producer_ids) //
+                .build(); //
+            eiTypes.put(id, i);
+            return eiTypes.get(id);
+        }
+
+        public void deleteEiTypeInstance(String id) {
+            eiTypes.remove(id);
+        }
+
+        public void deleteEiProducerInstance(String id) {
+            eiProducers.remove(id);
+        }
+
+        public void deleteEiJobInstance(String id) {
+            eiJobs.remove(id);
+        }
+
+        EiType getEiTypeInstance(String id) throws RestClientException {
+            EiType i = eiTypes.get(id);
+            if (i == null) {
+                throw new RestClientException("Type not found: " + id);
+            }
+            return i;
+        }
+
+        EiProducer getEiProducerInstance(String id) throws RestClientException {
+            EiProducer i = eiProducers.get(id);
+            if (i == null) {
+                throw new RestClientException("Producer not found: " + id);
+            }
+            return i;
+        }
+
+        public Collection<String> getAllEiTypeIds() {
+            return Collections.unmodifiableCollection(eiTypes.keySet());
+        }
+
+        public Collection<EiType> getAllEiTypes() {
+            return eiTypes.values();
+        }
+
+        public Collection<String> getAllEiProducerIds() {
+            return Collections.unmodifiableCollection(eiProducers.keySet());
+        }
+
+        public Collection<EiProducer> getAllEiProducers() {
+            return eiProducers.values();
+        }
+
+        public Collection<EiJob> getAllEiJobs() {
+            return eiJobs.values();
+        }
+
+        public List<EiJob> getEiJobsForOneEiProducer(Optional<String> eiProducerId) {
+            List<EiJob> result = new ArrayList<>();
+            for (EiJob i : eiJobs.values()) {
+                if (eiProducerId.isPresent()) {
+                    if (i.owner().equals(eiProducerId.get())) {
+                        result.add(i);
+                    }
+
+                } else {
+                    result.add(i);
+                }
+            }
+            return result;
+        }
+
+        private Map<String, EiType> eiTypes = new HashMap<>();
+        private Map<String, EiProducer> eiProducers = new HashMap<>();
+        private Map<String, EiJob> eiJobs = new HashMap<>();
+
+    }
+
+}
@@ -18,7 +18,7 @@
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oransc.portal.nonrtric.controlpanel.config;
+package org.oransc.portal.nonrtric.controlpanel.mock;
 
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doAnswer;
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oransc.portal.nonrtric.controlpanel.config;
+package org.oransc.portal.nonrtric.controlpanel.mock;
 
 import java.lang.invoke.MethodHandles;
 
 import org.oransc.portal.nonrtric.controlpanel.ControlPanelConstants;
+import org.oransc.portal.nonrtric.controlpanel.config.WebSecurityConfiguration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Value;
diff --git a/webapp-backend/src/test/resources/ei-type-1.json b/webapp-backend/src/test/resources/ei-type-1.json
new file mode 100644 (file)
index 0000000..c74ba28
--- /dev/null
@@ -0,0 +1,6 @@
+{
+    "$schema": "http://json-schema.org/draft-07/schema#",
+    "title": "STD_Type1_1.0.0",
+    "description": "EI-Type 1",
+    "type": "object"
+}
\ No newline at end of file
diff --git a/webapp-backend/src/test/resources/ei-type-2.json b/webapp-backend/src/test/resources/ei-type-2.json
new file mode 100644 (file)
index 0000000..68a1137
--- /dev/null
@@ -0,0 +1,6 @@
+{
+    "$schema": "http://json-schema.org/draft-07/schema#",
+    "title": "STD_Type2_1.0.0",
+    "description": "EI-Type 2",
+    "type": "object"
+}
\ No newline at end of file
diff --git a/webapp-backend/src/test/resources/job-1.json b/webapp-backend/src/test/resources/job-1.json
new file mode 100644 (file)
index 0000000..3f9e757
--- /dev/null
@@ -0,0 +1,5 @@
+{
+    "jobparam1":"value1",
+    "jobparam2":"value2",
+    "jobparam3":"value3"
+}