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