Merge "Pass rAppInstanceId to k8s participant and create the invoker with the instanc...
[nonrtric/plt/rappmanager.git] / rapp-manager-acm / src / test / java / com / oransc / rappmanager / acm / service / BeanTestConfiguration.java
index f59f8fb..5242f90 100755 (executable)
@@ -1,9 +1,30 @@
+/*-
+ * ============LICENSE_START======================================================================
+ * Copyright (C) 2023 Nordix Foundation. All rights reserved.
+ * Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
+ * ===============================================================================================
+ * 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 com.oransc.rappmanager.acm.service;
 
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.gson.Gson;
 import com.oransc.rappmanager.acm.ApiClient;
 import com.oransc.rappmanager.acm.configuration.ACMConfiguration;
+import com.oransc.rappmanager.acm.configuration.JacksonMessageConverterConfiguration;
 import com.oransc.rappmanager.acm.rest.AutomationCompositionDefinitionApiClient;
 import com.oransc.rappmanager.acm.rest.AutomationCompositionInstanceApiClient;
 import com.oransc.rappmanager.acm.rest.ParticipantMonitoringApiClient;
@@ -29,6 +50,11 @@ public class BeanTestConfiguration {
         return objectMapper;
     }
 
+    @Bean
+    public Gson gson() {
+        return new Gson();
+    }
+
     @Bean
     public RestTemplateBuilder restTemplateBuilder() {
         return new RestTemplateBuilder();
@@ -40,8 +66,10 @@ public class BeanTestConfiguration {
     }
 
     @Bean
-    public RestTemplate restTemplate(RestTemplateBuilder builder) {
-        return builder.build();
+    public RestTemplate restTemplate(RestTemplateBuilder builder, ObjectMapper objectMapper) {
+        RestTemplate restTemplate = builder.build();
+        restTemplate.getMessageConverters().add(new JacksonMessageConverterConfiguration(objectMapper));
+        return restTemplate;
     }
 
     @Bean("acmApiClient")