diff --git a/src/test/java/org/etsi/osl/services/api/sim638/ServiceRepoServiceTest.java b/src/test/java/org/etsi/osl/services/api/sim638/ServiceRepoServiceTest.java index 8ddf7b0620d1bfd6ded036343ee925a8caf44635..9a0308af7fce92310ae27d4b845f70fec68d1766 100644 --- a/src/test/java/org/etsi/osl/services/api/sim638/ServiceRepoServiceTest.java +++ b/src/test/java/org/etsi/osl/services/api/sim638/ServiceRepoServiceTest.java @@ -85,42 +85,42 @@ public class ServiceRepoServiceTest { } -// @WithMockUser(username="osadmin", roles = {"ADMIN","USER"}) -// @Test -// public void testFindAll() throws Exception { -// String response = createService(); -// Service responsesService = JsonUtils.toJsonObj(response, Service.class); -// String id = responsesService.getId(); -// -// List<Service> serviceList = serviceRepoService.findAll("Test Party", UserPartRoleType.REQUESTER); -// -// boolean idExists = false; -// for (Service s : serviceList) { -// if ( s.getId().equals( id ) ) { -// idExists= true; -// } -// } -// assertThat( idExists ).isTrue(); -// } -// -// @WithMockUser(username="osadmin", roles = {"ADMIN","USER"}) @Test - public void testUpdateService() throws Exception { + public void testFindAll() throws Exception { String response = createService(); Service responsesService = JsonUtils.toJsonObj(response, Service.class); String id = responsesService.getId(); - ServiceUpdate serviceUpdate = createServiceUpdateObject(); - serviceRepoService.updateService(id, serviceUpdate, true, null, null); + List<Service> serviceList = serviceRepoService.findAll("Test Party", UserPartRoleType.REQUESTER); - Service updatedService = serviceRepoService.findByUuid(id); - assertThat(updatedService.getType()).isEqualTo("Updated type"); - assertThat(updatedService.getName()).isEqualTo("Updated name"); - assertThat(updatedService.getServiceType()).isEqualTo("Updated Service Type"); + boolean idExists = false; + for (Service s : serviceList) { + if ( s.getId().equals( id ) ) { + idExists= true; + } + } + assertThat( idExists ).isTrue(); } +// @WithMockUser(username="osadmin", roles = {"ADMIN","USER"}) +// @Test +// public void testUpdateService() throws Exception { +// String response = createService(); +// Service responsesService = JsonUtils.toJsonObj(response, Service.class); +// String id = responsesService.getId(); +// +// ServiceUpdate serviceUpdate = createServiceUpdateObject(); +// serviceRepoService.updateService(id, serviceUpdate, true, null, null); +// +// Service updatedService = serviceRepoService.findByUuid(id); +// assertThat(updatedService.getType()).isEqualTo("Updated type"); +// assertThat(updatedService.getName()).isEqualTo("Updated name"); +// assertThat(updatedService.getServiceType()).isEqualTo("Updated Service Type"); +// } + + // @WithMockUser(username="osadmin", roles = {"ADMIN","USER"}) // @Test // public void testDeleteServiceActionQueueItemByUuid() throws Exception {