e9a5c8b3e9da4a533cb787c847da3a26855ccb05
[sdnc/apps.git] /
1 package org.onap.sdnc.apps.ms.gra.controllers;
2
3 import com.fasterxml.jackson.databind.ObjectMapper;
4 import org.junit.BeforeClass;
5 import org.junit.Test;
6 import org.junit.runner.RunWith;
7 import org.onap.sdnc.apps.ms.gra.GenericResourceMsApp;
8 import org.onap.sdnc.apps.ms.gra.data.ConfigPreloadData;
9 import org.onap.sdnc.apps.ms.gra.data.ConfigPreloadDataRepository;
10 import org.onap.sdnc.apps.ms.gra.data.ConfigServices;
11 import org.onap.sdnc.apps.ms.gra.data.ConfigServicesRepository;
12 import org.onap.sdnc.apps.ms.gra.swagger.model.GenericResourceApiServiceModelInfrastructure;
13 import org.onap.sdnc.apps.ms.gra.swagger.model.GenericResourceApiServicemodelinfrastructureService;
14 import org.springframework.beans.factory.annotation.Autowired;
15 import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
16 import org.springframework.boot.test.context.SpringBootTest;
17 import org.springframework.http.MediaType;
18 import org.springframework.test.context.junit4.SpringRunner;
19 import org.springframework.test.web.servlet.MockMvc;
20 import org.springframework.test.web.servlet.MvcResult;
21 import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
22 import org.springframework.transaction.annotation.Transactional;
23
24 import java.io.IOException;
25 import java.nio.file.Files;
26 import java.nio.file.Paths;
27 import java.util.List;
28
29 import static org.junit.Assert.assertEquals;
30 import static org.junit.Assert.assertNotEquals;
31 import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.request;
32
33 @RunWith(SpringRunner.class)
34 @SpringBootTest(classes={GenericResourceMsApp.class})
35 @AutoConfigureMockMvc
36 @Transactional
37 public class ConfigApiServicesControllerTest {
38
39     private final static String CONFIG_SERVICES_URL = "/config/GENERIC-RESOURCE-API:services/";
40     private final static String CONFIG_SERVICES_SERVICE_URL = "/config/GENERIC-RESOURCE-API:services/GENERIC-RESOURCE-API:service/";
41
42     @Autowired
43     private MockMvc mvc;
44
45     @Autowired
46     ConfigServicesRepository configServicesRepository;
47
48     @BeforeClass
49     public static void setUp() throws Exception {
50         System.out.println("ConfigApiServicesControllerTest: Setting serviceLogicProperties, serviceLogicDirectory and sdnc.config.dir");
51         System.setProperty("serviceLogicProperties", "src/test/resources/svclogic.properties");
52         System.setProperty("serviceLogicDirectory", "src/test/resources/svclogic");
53         System.setProperty("sdnc.config.dir", "src/test/resources");
54    
55     }
56
57
58     @Test
59     public void configGENERICRESOURCEAPIservicesDelete() throws Exception {
60
61         // Clean up data
62         configServicesRepository.deleteAll();
63
64         // Load test data
65         loadServicesData( "src/test/resources/service1.json");
66
67         assertEquals(1, configServicesRepository.count());
68         MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.delete(CONFIG_SERVICES_URL).contentType(MediaType.APPLICATION_JSON).content(""))
69                 .andReturn();
70         assertEquals(204, mvcResult.getResponse().getStatus());
71         assertEquals(0, configServicesRepository.count());
72
73         // Test with no data
74         mvcResult = mvc.perform(MockMvcRequestBuilders.delete(CONFIG_SERVICES_URL).contentType(MediaType.APPLICATION_JSON).content(""))
75                 .andReturn();
76         assertEquals(204, mvcResult.getResponse().getStatus());
77
78     }
79
80     @Test
81     public void configGENERICRESOURCEAPIservicesGet() throws Exception {
82         // Clean up data
83         configServicesRepository.deleteAll();
84
85         // Test with data
86         loadServicesData("src/test/resources/service1.json");
87         assert(configServicesRepository.count() > 0);
88
89         MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.get(CONFIG_SERVICES_URL).contentType(MediaType.APPLICATION_JSON).content(""))
90                 .andReturn();
91         assertEquals(200, mvcResult.getResponse().getStatus());
92
93         // Test with no data
94         configServicesRepository.deleteAll();
95         mvcResult = mvc.perform(MockMvcRequestBuilders.get(CONFIG_SERVICES_URL).contentType(MediaType.APPLICATION_JSON).content(""))
96                 .andReturn();
97         assertEquals(404, mvcResult.getResponse().getStatus());
98     }
99
100     @Test
101     public void configGENERICRESOURCEAPIservicesPost() throws Exception {
102         // Clean up data
103         configServicesRepository.deleteAll();
104
105         String content = readFileContent("src/test/resources/service1.json");
106
107         // Test with no data
108         MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.post(CONFIG_SERVICES_URL).contentType(MediaType.APPLICATION_JSON).content(content))
109                 .andReturn();
110         assertEquals(201, mvcResult.getResponse().getStatus());
111         assertEquals(1, configServicesRepository.count());
112
113         // Test with existing data - should return 409
114         mvcResult = mvc.perform(MockMvcRequestBuilders.post(CONFIG_SERVICES_URL).contentType(MediaType.APPLICATION_JSON).content(content))
115                 .andReturn();
116         assertEquals(409, mvcResult.getResponse().getStatus());
117         assertEquals(1, configServicesRepository.count());
118
119         // Clean up data
120         configServicesRepository.deleteAll();
121
122     }
123
124     @Test
125     public void configGENERICRESOURCEAPIservicesPut() throws Exception {
126         // Clean up data
127         configServicesRepository.deleteAll();
128
129         String content = readFileContent("src/test/resources/service1.json");
130
131         // Test with no data
132         MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.put(CONFIG_SERVICES_URL).contentType(MediaType.APPLICATION_JSON).content(content))
133                 .andReturn();
134         assertEquals(201, mvcResult.getResponse().getStatus());
135         assertEquals(1, configServicesRepository.count());
136
137         // Test with existing data - should return 409
138         mvcResult = mvc.perform(MockMvcRequestBuilders.put(CONFIG_SERVICES_URL).contentType(MediaType.APPLICATION_JSON).content(content))
139                 .andReturn();
140         assertEquals(204, mvcResult.getResponse().getStatus());
141         assertEquals(1, configServicesRepository.count());
142
143         // Clean up data
144         configServicesRepository.deleteAll();
145
146     }
147
148     @Test
149     public void configGENERICRESOURCEAPIservicesGENERICRESOURCEAPIserviceServiceInstanceIdDelete() throws Exception {
150         // Clean up data
151         configServicesRepository.deleteAll();
152
153         // Test with no data
154         MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.delete(CONFIG_SERVICES_SERVICE_URL+"service1/").contentType(MediaType.APPLICATION_JSON).content(""))
155                 .andReturn();
156         assertEquals(204, mvcResult.getResponse().getStatus());
157         assertEquals(0, configServicesRepository.count());
158
159         // Load data
160         loadServicesData("src/test/resources/service1.json");
161         assertEquals(1, configServicesRepository.count());
162
163         // Test with data
164         mvcResult = mvc.perform(MockMvcRequestBuilders.delete(CONFIG_SERVICES_SERVICE_URL+"service1/").contentType(MediaType.APPLICATION_JSON).content(""))
165                 .andReturn();
166         assertEquals(204, mvcResult.getResponse().getStatus());
167         assertEquals(0, configServicesRepository.count());
168
169     }
170
171     @Test
172     public void configGENERICRESOURCEAPIservicesGENERICRESOURCEAPIserviceServiceInstanceIdGet() throws Exception {
173         // Clean up data
174         configServicesRepository.deleteAll();
175
176         // Test with data
177         loadServicesData("src/test/resources/service1.json");
178         assert(configServicesRepository.count() > 0);
179
180         MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.get(CONFIG_SERVICES_SERVICE_URL+"service1/").contentType(MediaType.APPLICATION_JSON).content(""))
181                 .andReturn();
182         assertEquals(200, mvcResult.getResponse().getStatus());
183
184         // Test with no data
185         configServicesRepository.deleteAll();
186         mvcResult = mvc.perform(MockMvcRequestBuilders.get(CONFIG_SERVICES_SERVICE_URL+"service1/").contentType(MediaType.APPLICATION_JSON).content(""))
187                 .andReturn();
188         assertEquals(404, mvcResult.getResponse().getStatus());
189     }
190
191     @Test
192     public void configGENERICRESOURCEAPIservicesGENERICRESOURCEAPIserviceServiceInstanceIdPost() throws Exception {
193         // Clean up data
194         configServicesRepository.deleteAll();
195
196         String content = readFileContent("src/test/resources/service1-serviceitem.json");
197
198         // Test with no data
199         MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.post(CONFIG_SERVICES_SERVICE_URL+"service1/").contentType(MediaType.APPLICATION_JSON).content(content))
200                 .andReturn();
201         assertEquals(201, mvcResult.getResponse().getStatus());
202         assertEquals(1, configServicesRepository.count());
203
204         // Test with existing data - should return 409
205         mvcResult = mvc.perform(MockMvcRequestBuilders.post(CONFIG_SERVICES_SERVICE_URL+"service1/").contentType(MediaType.APPLICATION_JSON).content(content))
206                 .andReturn();
207         assertEquals(409, mvcResult.getResponse().getStatus());
208         assertEquals(1, configServicesRepository.count());
209
210         // Clean up data
211         configServicesRepository.deleteAll();
212
213     }
214
215     @Test
216     public void configGENERICRESOURCEAPIservicesGENERICRESOURCEAPIserviceServiceInstanceIdPut() throws Exception {
217         // Clean up data
218         configServicesRepository.deleteAll();
219
220         String content = readFileContent("src/test/resources/service1-serviceitem.json");
221
222         // Test with no data
223         MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.put(CONFIG_SERVICES_SERVICE_URL+"service1/").contentType(MediaType.APPLICATION_JSON).content(content))
224                 .andReturn();
225         assertEquals(201, mvcResult.getResponse().getStatus());
226         assertEquals(1, configServicesRepository.count());
227
228         // Test with existing data - should return 409
229         mvcResult = mvc.perform(MockMvcRequestBuilders.put(CONFIG_SERVICES_SERVICE_URL+"service1/").contentType(MediaType.APPLICATION_JSON).content(content))
230                 .andReturn();
231         assertEquals(204, mvcResult.getResponse().getStatus());
232         assertEquals(1, configServicesRepository.count());
233
234         // Clean up data
235         configServicesRepository.deleteAll();
236     }
237
238     @Test
239     public void configGENERICRESOURCEAPIservicesGENERICRESOURCEAPIserviceServiceInstanceIdGENERICRESOURCEAPIserviceDataDelete() throws Exception {
240         // Clean up data
241         configServicesRepository.deleteAll();
242
243         // Test with no data
244         MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.delete(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-data/").contentType(MediaType.APPLICATION_JSON).content(""))
245                 .andReturn();
246         assertEquals(404, mvcResult.getResponse().getStatus());
247         assertEquals(0, configServicesRepository.count());
248
249         // Load data
250         loadServicesData("src/test/resources/service1.json");
251         assertEquals(1, configServicesRepository.count());
252
253         // Test with data
254         mvcResult = mvc.perform(MockMvcRequestBuilders.delete(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-data/").contentType(MediaType.APPLICATION_JSON).content(""))
255                 .andReturn();
256         assertEquals(204, mvcResult.getResponse().getStatus());
257         assertEquals(1, configServicesRepository.count());
258         List<ConfigServices> services = configServicesRepository.findBySvcInstanceId("service1");
259         assertEquals(1, services.size());
260         assertEquals(null, services.get(0).getSvcData());
261
262
263     }
264
265     @Test
266     public void configGENERICRESOURCEAPIservicesGENERICRESOURCEAPIserviceServiceInstanceIdGENERICRESOURCEAPIserviceDataGet() throws Exception {
267         // Clean up data
268         configServicesRepository.deleteAll();
269
270         // Test with data
271         loadServicesData("src/test/resources/service1.json");
272         assert(configServicesRepository.count() > 0);
273
274         MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.get(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-data/").contentType(MediaType.APPLICATION_JSON).content(""))
275                 .andReturn();
276         assertEquals(200, mvcResult.getResponse().getStatus());
277
278         // Test with no data
279         configServicesRepository.deleteAll();
280         mvcResult = mvc.perform(MockMvcRequestBuilders.get(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-data/").contentType(MediaType.APPLICATION_JSON).content(""))
281                 .andReturn();
282         assertEquals(404, mvcResult.getResponse().getStatus());
283     }
284
285     @Test
286     public void configGENERICRESOURCEAPIservicesGENERICRESOURCEAPIserviceServiceInstanceIdGENERICRESOURCEAPIserviceDataPost() throws Exception {
287         // Clean up data
288         configServicesRepository.deleteAll();
289
290         String content = readFileContent("src/test/resources/service1-servicedata.json");
291
292         // Test with no data
293         MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.post(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-data/").contentType(MediaType.APPLICATION_JSON).content(content))
294                 .andReturn();
295         assertEquals(404, mvcResult.getResponse().getStatus());
296         assertEquals(0, configServicesRepository.count());
297
298         // Test with empty service data
299         ConfigServices service = new ConfigServices();
300         service.setSvcInstanceId("service1");
301         configServicesRepository.save(service);
302         assertEquals(1, configServicesRepository.count());
303         mvcResult = mvc.perform(MockMvcRequestBuilders.post(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-data/").contentType(MediaType.APPLICATION_JSON).content(content))
304                 .andReturn();
305         assertEquals(201, mvcResult.getResponse().getStatus());
306         assertEquals(1, configServicesRepository.count());
307         List<ConfigServices> updatedService = configServicesRepository.findBySvcInstanceId("service1");
308         assertEquals(1, updatedService.size());
309         assertNotEquals(null, updatedService.get(0).getSvcData());
310
311         // Test with existing data - should return 409
312         mvcResult = mvc.perform(MockMvcRequestBuilders.post(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-data/").contentType(MediaType.APPLICATION_JSON).content(content))
313                 .andReturn();
314         assertEquals(409, mvcResult.getResponse().getStatus());
315
316         // Clean up data
317         configServicesRepository.deleteAll();
318     }
319
320     @Test
321     public void configGENERICRESOURCEAPIservicesGENERICRESOURCEAPIserviceServiceInstanceIdGENERICRESOURCEAPIserviceDataPut() throws Exception {
322         // Clean up data
323         configServicesRepository.deleteAll();
324
325         String content = readFileContent("src/test/resources/service1-servicedata.json");
326
327         // Test with no data
328         MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.put(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-data/").contentType(MediaType.APPLICATION_JSON).content(content))
329                 .andReturn();
330         assertEquals(404, mvcResult.getResponse().getStatus());
331         assertEquals(0, configServicesRepository.count());
332
333         // Test with empty service data
334         ConfigServices service = new ConfigServices();
335         service.setSvcInstanceId("service1");
336         configServicesRepository.save(service);
337         mvcResult = mvc.perform(MockMvcRequestBuilders.put(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-data/").contentType(MediaType.APPLICATION_JSON).content(content))
338                 .andReturn();
339         assertEquals(201, mvcResult.getResponse().getStatus());
340         assertEquals(1, configServicesRepository.count());
341         List<ConfigServices> updatedService = configServicesRepository.findBySvcInstanceId("service1");
342         assertEquals(1, updatedService.size());
343         assertNotEquals(null, updatedService.get(0).getSvcData());
344
345         // Test with existing data - should return 204
346         mvcResult = mvc.perform(MockMvcRequestBuilders.put(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-data/").contentType(MediaType.APPLICATION_JSON).content(content))
347                 .andReturn();
348         assertEquals(204, mvcResult.getResponse().getStatus());
349
350         // Clean up data
351         configServicesRepository.deleteAll();
352     }
353
354     @Test
355     public void configGENERICRESOURCEAPIservicesGENERICRESOURCEAPIserviceServiceInstanceIdGENERICRESOURCEAPIserviceStatusDelete() throws Exception {
356         // Clean up data
357         configServicesRepository.deleteAll();
358
359         // Test with no data
360         MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.delete(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-status/").contentType(MediaType.APPLICATION_JSON).content(""))
361                 .andReturn();
362         assertEquals(404, mvcResult.getResponse().getStatus());
363         assertEquals(0, configServicesRepository.count());
364
365         // Load data
366         loadServicesData("src/test/resources/service1.json");
367         assertEquals(1, configServicesRepository.count());
368
369         // Test with data
370         mvcResult = mvc.perform(MockMvcRequestBuilders.delete(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-status/").contentType(MediaType.APPLICATION_JSON).content(""))
371                 .andReturn();
372         assertEquals(204, mvcResult.getResponse().getStatus());
373         assertEquals(1, configServicesRepository.count());
374         List<ConfigServices> services = configServicesRepository.findBySvcInstanceId("service1");
375         assertEquals(1, services.size());
376         assertEquals(null, services.get(0).getServiceStatus());
377     }
378
379     @Test
380     public void configGENERICRESOURCEAPIservicesGENERICRESOURCEAPIserviceServiceInstanceIdGENERICRESOURCEAPIserviceStatusGet() throws Exception {
381         // Clean up data
382         configServicesRepository.deleteAll();
383
384         // Test with data
385         loadServicesData("src/test/resources/service1.json");
386         assert(configServicesRepository.count() > 0);
387
388         MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.get(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-status/").contentType(MediaType.APPLICATION_JSON).content(""))
389                 .andReturn();
390         assertEquals(200, mvcResult.getResponse().getStatus());
391
392         // Test with no data
393         configServicesRepository.deleteAll();
394         mvcResult = mvc.perform(MockMvcRequestBuilders.get(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-status/").contentType(MediaType.APPLICATION_JSON).content(""))
395                 .andReturn();
396         assertEquals(404, mvcResult.getResponse().getStatus());
397     }
398
399     @Test
400     public void configGENERICRESOURCEAPIservicesGENERICRESOURCEAPIserviceServiceInstanceIdGENERICRESOURCEAPIserviceStatusPost() throws Exception {
401         // Clean up data
402         configServicesRepository.deleteAll();
403
404         String content = readFileContent("src/test/resources/service1-servicestatus.json");
405
406         // Test with no data
407         MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.post(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-status/").contentType(MediaType.APPLICATION_JSON).content(content))
408                 .andReturn();
409         assertEquals(404, mvcResult.getResponse().getStatus());
410         assertEquals(0, configServicesRepository.count());
411
412         // Test with empty service data
413         ConfigServices service = new ConfigServices();
414         service.setSvcInstanceId("service1");
415         configServicesRepository.save(service);
416         mvcResult = mvc.perform(MockMvcRequestBuilders.post(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-status/").contentType(MediaType.APPLICATION_JSON).content(content))
417                 .andReturn();
418         assertEquals(201, mvcResult.getResponse().getStatus());
419         assertEquals(1, configServicesRepository.count());
420         List<ConfigServices> updatedService = configServicesRepository.findBySvcInstanceId("service1");
421         assertEquals(1, updatedService.size());
422         assertNotEquals(null, updatedService.get(0).getServiceStatus());
423
424         // Test with existing data - should return 409
425         mvcResult = mvc.perform(MockMvcRequestBuilders.post(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-status/").contentType(MediaType.APPLICATION_JSON).content(content))
426                 .andReturn();
427         assertEquals(409, mvcResult.getResponse().getStatus());
428
429         // Clean up data
430         configServicesRepository.deleteAll();
431     }
432
433     @Test
434     public void configGENERICRESOURCEAPIservicesGENERICRESOURCEAPIserviceServiceInstanceIdGENERICRESOURCEAPIserviceStatusPut() throws Exception {
435         // Clean up data
436         configServicesRepository.deleteAll();
437
438         String content = readFileContent("src/test/resources/service1-servicestatus.json");
439
440         // Test with no data
441         MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.put(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-status/").contentType(MediaType.APPLICATION_JSON).content(content))
442                 .andReturn();
443         assertEquals(404, mvcResult.getResponse().getStatus());
444         assertEquals(0, configServicesRepository.count());
445
446         // Test with empty service status
447         ConfigServices service = new ConfigServices();
448         service.setSvcInstanceId("service1");
449         configServicesRepository.save(service);
450         mvcResult = mvc.perform(MockMvcRequestBuilders.put(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-status/").contentType(MediaType.APPLICATION_JSON).content(content))
451                 .andReturn();
452         assertEquals(201, mvcResult.getResponse().getStatus());
453         assertEquals(1, configServicesRepository.count());
454         List<ConfigServices> updatedService = configServicesRepository.findBySvcInstanceId("service1");
455         assertEquals(1, updatedService.size());
456         assertNotEquals(null, updatedService.get(0).getServiceStatus());
457
458         // Test with existing data - should return 204
459         mvcResult = mvc.perform(MockMvcRequestBuilders.put(CONFIG_SERVICES_SERVICE_URL+"service1/GENERIC-RESOURCE-API:service-status/").contentType(MediaType.APPLICATION_JSON).content(content))
460                 .andReturn();
461         assertEquals(204, mvcResult.getResponse().getStatus());
462
463         // Clean up data
464         configServicesRepository.deleteAll();
465     }
466
467     private String readFileContent(String path) throws IOException {
468         String content = new String(Files.readAllBytes(Paths.get(path)));
469         return content;
470     }
471
472     private void deleteData(String url) throws Exception {
473         mvc.perform(MockMvcRequestBuilders.delete(url).contentType(MediaType.APPLICATION_JSON).content(""))
474                 .andReturn();
475     }
476
477     private void loadServicesData(String path) throws IOException {
478         ObjectMapper objectMapper = new ObjectMapper();
479         String content = readFileContent(path);
480         GenericResourceApiServiceModelInfrastructure services = objectMapper.readValue(content, GenericResourceApiServiceModelInfrastructure.class);
481
482         for (GenericResourceApiServicemodelinfrastructureService service : services.getService()) {
483             ConfigServices newService = new ConfigServices();
484             newService.setSvcInstanceId(service.getServiceInstanceId());
485             newService.setSvcData(objectMapper.writeValueAsString(service.getServiceData()));
486             newService.setServiceStatus(service.getServiceStatus());
487             configServicesRepository.save(newService);
488         }
489     }
490
491 }