diff --git a/MySQL_conf_pbx/test1/Rest-API-Postman/CezenPBX_API.postman_collection.json b/MySQL_conf_pbx/test1/Rest-API-Postman/CezenPBX_API.postman_collection.json index 11e085e..92ed814 100644 --- a/MySQL_conf_pbx/test1/Rest-API-Postman/CezenPBX_API.postman_collection.json +++ b/MySQL_conf_pbx/test1/Rest-API-Postman/CezenPBX_API.postman_collection.json @@ -13,7 +13,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"id\": \"1005\",\n \"transport\": \"transport-udp\",\n \"aors\": \"1005\",\n \"auth\": \"1005\",\n \"context\": \"default\",\n \"disallow\": \"all\",\n \"allow\": \"ulaw,alaw\",\n \"directMedia\": \"no\",\n \"connectedLineMethod\": null,\n \"callerid\": null,\n \"dtmfMode\": null,\n \"mohsuggest\": \"default\",\n \"mailboxes\": null\n}\n\n// {\n// \"id\": \"1004\",\n// \"transport\": \"transport-udp\",\n// \"aors\": \"1004\",\n// \"auth\": \"1004\",\n// \"context\": \"default\",\n// \"disallow\": \"all\",\n// \"allow\": \"ulaw,alaw\",\n// \"directMedia\": \"no\",\n// \"connectedLineMethod\": null,\n// \"callerid\": \"User <1004>\",\n// \"dtmfMode\": null,\n// \"mohsuggest\": \"default\",\n// \"mailboxes\": \"1004@default\"\n// }", + "raw": "{\n \"id\": \"1005\",\n// \"transport\": \"transport-udp\",\n// \"context\": \"default\",\n// \"disallow\": \"all\",\n// \"allow\": \"ulaw,alaw\",\n// \"directMedia\": \"no\",\n \"connectedLineMethod\": null,\n \"callerid\": null,\n \"dtmfMode\": null,\n// \"mohsuggest\": \"default\",\n \"mailboxes\": null\n}\n\n// {\n// \"id\": \"1004\",\n// \"transport\": \"transport-udp\",\n// \"aors\": \"1004\",\n// \"auth\": \"1004\",\n// \"context\": \"default\",\n// \"disallow\": \"all\",\n// \"allow\": \"ulaw,alaw\",\n// \"directMedia\": \"no\",\n// \"connectedLineMethod\": null,\n// \"callerid\": \"User <1004>\",\n// \"dtmfMode\": null,\n// \"mohsuggest\": \"default\",\n// \"mailboxes\": \"1004@default\"\n// }", "options": { "raw": { "language": "json" @@ -94,7 +94,7 @@ "response": [] }, { - "name": "New Request", + "name": "SetAORS", "request": { "method": "POST", "header": [], @@ -121,6 +121,32 @@ } }, "response": [] + }, + { + "name": "DeleteExtension", + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "http://localhost:8081/cezen/delete_extension?sipNumber=testEndPoint", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8081", + "path": [ + "cezen", + "delete_extension" + ], + "query": [ + { + "key": "sipNumber", + "value": "testEndPoint" + } + ] + } + }, + "response": [] } ] } \ No newline at end of file diff --git a/MySQL_conf_pbx/test1/mariadb_data/aria_log.00000001 b/MySQL_conf_pbx/test1/mariadb_data/aria_log.00000001 index 2bc4d79..7c51317 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/aria_log.00000001 and b/MySQL_conf_pbx/test1/mariadb_data/aria_log.00000001 differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/aria_log_control b/MySQL_conf_pbx/test1/mariadb_data/aria_log_control index f221f0d..0eb2a97 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/aria_log_control and b/MySQL_conf_pbx/test1/mariadb_data/aria_log_control differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/extensions_table.ibd b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/extensions_table.ibd index 0e2475c..c19bf89 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/extensions_table.ibd and b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/extensions_table.ibd differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_aors.ibd b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_aors.ibd index b2a159c..c053994 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_aors.ibd and b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_aors.ibd differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_auths.ibd b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_auths.ibd index 3965b13..1b36389 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_auths.ibd and b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_auths.ibd differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_endpoints.ibd b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_endpoints.ibd index 2235245..9d09275 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_endpoints.ibd and b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_endpoints.ibd differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/ib_logfile0 b/MySQL_conf_pbx/test1/mariadb_data/ib_logfile0 index ee82e54..e441f53 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/ib_logfile0 and b/MySQL_conf_pbx/test1/mariadb_data/ib_logfile0 differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/ibdata1 b/MySQL_conf_pbx/test1/mariadb_data/ibdata1 index c3cc124..bb14089 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/ibdata1 and b/MySQL_conf_pbx/test1/mariadb_data/ibdata1 differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_index_stats.ibd b/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_index_stats.ibd index 194297b..16c7574 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_index_stats.ibd and b/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_index_stats.ibd differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_table_stats.ibd b/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_table_stats.ibd index f6504e8..9a2532f 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_table_stats.ibd and b/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_table_stats.ibd differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/undo001 b/MySQL_conf_pbx/test1/mariadb_data/undo001 index 0dbcd86..dd29c22 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/undo001 and b/MySQL_conf_pbx/test1/mariadb_data/undo001 differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/undo002 b/MySQL_conf_pbx/test1/mariadb_data/undo002 index 4c3e524..708b286 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/undo002 and b/MySQL_conf_pbx/test1/mariadb_data/undo002 differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/undo003 b/MySQL_conf_pbx/test1/mariadb_data/undo003 index 2ae60d6..4638c31 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/undo003 and b/MySQL_conf_pbx/test1/mariadb_data/undo003 differ diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/DAO/BasicAsteriskOpsDAO.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/DAO/BasicAsteriskOpsDAO.java index ac7a909..8d76b84 100644 --- a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/DAO/BasicAsteriskOpsDAO.java +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/DAO/BasicAsteriskOpsDAO.java @@ -3,6 +3,8 @@ package com.example.cezenPBX.DAO; import com.example.cezenPBX.DTO.ReturnStatus; import com.example.cezenPBX.entity.*; import jakarta.persistence.EntityManager; +import jakarta.persistence.Query; +import jakarta.persistence.TypedQuery; import jakarta.transaction.Transactional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; @@ -40,6 +42,11 @@ public class BasicAsteriskOpsDAO implements CezenPbxOpsDAO { @Transactional public ReturnStatus saveAnExtension(ExtensionsTable extensionsTable) { + int priorityNumber = getTheHighestPriorityNumberByEndpoint(extensionsTable.getExtension()); + + // it's the first entry set priority to 1 + if(priorityNumber == 0) extensionsTable.setPriority(1); + //save only if endpoint exists return persistOnlyIfEndpointExists(extensionsTable); } @@ -74,4 +81,35 @@ public class BasicAsteriskOpsDAO implements CezenPbxOpsDAO { return new ReturnStatus(true, endpoint + " Persisted ", ""); } + + // this gets the + @Override + public int getTheHighestPriorityNumberByEndpoint(String endpoint) { + + // fetches the highest priority + String query = "SELECT MAX(e.priority) FROM ExtensionsTable AS e WHERE e.extension = :endpoint"; + + //get the highest priority + try{ + TypedQuery queryResult = this.entityManager.createQuery(query, Integer.class); + queryResult.setParameter("endpoint", endpoint); + return queryResult.getSingleResult(); + + }catch (Exception e){ + // that means endpoint doesnt exist yet + return 0; + } + } + + // delete extension by endoint + @Override + @Transactional + public boolean deleteAnExtensionPoint(String endpoint) { + + Query query = this.entityManager.createQuery("DELETE FROM ExtensionsTable e WHERE e.extension = :extension"); + + query.setParameter("extension", endpoint); + + return query.executeUpdate() == 1; + } } diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/DAO/CezenPbxOpsDAO.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/DAO/CezenPbxOpsDAO.java index cc2a763..0ce7d36 100644 --- a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/DAO/CezenPbxOpsDAO.java +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/DAO/CezenPbxOpsDAO.java @@ -15,4 +15,8 @@ public interface CezenPbxOpsDAO { ReturnStatus setThePasswordForSipEndpoint(PsAuths psAuths); ReturnStatus setTheAorsForTheEndPoint(PsAors psAors); + + int getTheHighestPriorityNumberByEndpoint(String endpoint); + + boolean deleteAnExtensionPoint(String endpoint); } diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/controller/CezenPbxController.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/controller/CezenPbxController.java index 2078369..6d8a9b1 100644 --- a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/controller/CezenPbxController.java +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/controller/CezenPbxController.java @@ -3,10 +3,7 @@ import com.example.cezenPBX.DTO.*; import com.example.cezenPBX.service.BasicPbxServiceInterface; import jakarta.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/cezen") @@ -77,4 +74,10 @@ public class CezenPbxController { psAorsDTO.maxContacts() ); } + + @DeleteMapping("/delete_extension") + public boolean deleteExtensionBySipNumber(@RequestParam String sipNumber){ + + return this.basicPbxServiceInterface.deleteByExtension(sipNumber); + } } diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/entity/PsAors.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/entity/PsAors.java index b998324..77049e9 100644 --- a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/entity/PsAors.java +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/entity/PsAors.java @@ -37,3 +37,26 @@ public class PsAors implements PBXentiry{ this.maxContacts = maxContacts; } } + +// bellow can also work +//@Table(name = "ps_aors") +//@Entity +//public record PsAors( +// @Id +// @Column(name = "id") +// String extension, +// +// @Column(name = "max_contacts") +// int maxContacts +//) implements PBXentiry{ +// +// public PsAors() { +// this("",0); +// +// } +// +// @Override +// public String getExtension() { +// return this.extension; +// } +//} \ No newline at end of file diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/entity/PsAuths.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/entity/PsAuths.java index 795337a..f9c610c 100644 --- a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/entity/PsAuths.java +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/entity/PsAuths.java @@ -38,6 +38,9 @@ public class PsAuths implements PBXentiry{ this.realm = realm; } + public PsAuths() { + } + public String getExtension() { return extension; } diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/service/BasicPbxService.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/service/BasicPbxService.java index 0efc5c7..9f76bef 100644 --- a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/service/BasicPbxService.java +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/service/BasicPbxService.java @@ -94,4 +94,10 @@ public class BasicPbxService implements BasicPbxServiceInterface { return new ReturnStatus(false, "Endpoint and password already set ",e.getMessage()); } } + + @Override + public boolean deleteByExtension(String extensionNumber) { + + return this.cezenPbxOpsDAO.deleteAnExtensionPoint(extensionNumber); + } } diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/service/BasicPbxServiceInterface.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/service/BasicPbxServiceInterface.java index 9967d86..5279985 100644 --- a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/service/BasicPbxServiceInterface.java +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/service/BasicPbxServiceInterface.java @@ -16,4 +16,6 @@ public interface BasicPbxServiceInterface { public ReturnStatus addAPasswordForEndpoint(String id, String authType, String userName, String password, String md5Cred, String realm); public ReturnStatus setAors(String id, int maxContacts); + + public boolean deleteByExtension(String extensionNumber); } diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/test/java/com/example/cezenPBX/controller/PbxControllerIntegrationTest.java b/MySQL_conf_pbx/test1/springCezenPBX/src/test/java/com/example/cezenPBX/controller/PbxControllerIntegrationTest.java new file mode 100644 index 0000000..15e32e0 --- /dev/null +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/test/java/com/example/cezenPBX/controller/PbxControllerIntegrationTest.java @@ -0,0 +1,198 @@ +package com.example.cezenPBX.controller; + + +import com.example.cezenPBX.DTO.ReturnStatus; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.json.JSONException; +import org.json.JSONObject; +import org.junit.jupiter.api.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.http.*; + +import java.util.List; + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +public class PbxControllerIntegrationTest { + + @Autowired + private TestRestTemplate restTemplate; + + + static HttpEntity stringBasedRequest; + + + static HttpEntity extensionEndpoint; + + @BeforeAll + public static void createAnEndpoint() throws JSONException { + + JSONObject endpointDetails = new JSONObject(); + endpointDetails.put("id","testEndpoint"); +// endpointDetails.put("transport",""); +// endpointDetails.put("context",""); +// endpointDetails.put("disallow",""); +// endpointDetails.put("allow",""); +// endpointDetails.put("directMedia",""); + endpointDetails.put("connectedLineMethod",null); + endpointDetails.put("callerid",null); + endpointDetails.put("dtmfMode",null); +// endpointDetails.put("mohsuggest",""); + endpointDetails.put("mailboxes",null); + + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + headers.setAccept(List.of(MediaType.APPLICATION_JSON)); + + stringBasedRequest = new HttpEntity<>(endpointDetails.toString(), headers); + + //Arrange + JSONObject extensionDetails = new JSONObject(); + extensionDetails.put("context","default"); + extensionDetails.put("extension","testEndpoint"); + extensionDetails.put("priority","5"); + extensionDetails.put("app","Dial"); + extensionDetails.put("appdata","PJSIP/1005,20,m(default)"); + + extensionEndpoint = new HttpEntity(extensionDetails.toString(), headers); + } + + + // test will create an testEndpoint endpoint + @Test + @DisplayName("User can be created") + @Order(1) + void testIfEndpointCanBeCreatedWithValidInput() { + // Act + ResponseEntity response = this.restTemplate.postForEntity("/cezen/add_user", stringBasedRequest, String.class); + + // Assert + Assertions.assertEquals(HttpStatus.OK, response.getStatusCode(), () -> "Wrong Status Code"); + } + + //duplicate entry must return false + @Test + @DisplayName("Duplicate values must result in false") + @Order(2) + void integrationTest_duplicateValurSubmission_ThrowsAnException() { + // Act + ResponseEntity response = this.restTemplate.postForEntity("/cezen/add_user", stringBasedRequest, String.class); + String responseBody = response.getBody(); + + // Assert + Assertions.assertEquals(HttpStatus.OK, response.getStatusCode(), () -> "Wrong Status Code"); + Assertions.assertEquals("false", responseBody, () -> "must return false when value already exists"); + } + + + // test for extension + + // if SIP end point doesn't exist then return a json ReturnStatus object with false in it + + @Test + @DisplayName("For no SIP endpoint Should return ReturnStatus object with false in it") + public void extensionTest_tryingToAddAnExtensionIfSipEndpointDoesntExist_returnAReturnStatusObjectWithFalseInIt() throws JSONException, JsonProcessingException { + + //Arrange + JSONObject extensionDetails = new JSONObject(); + extensionDetails.put("context","default"); + extensionDetails.put("extension","NoEndPointEver"); + extensionDetails.put("priority","5"); + extensionDetails.put("app","Dial"); + extensionDetails.put("appdata","PJSIP/1005,20,m(default)"); + + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + headers.setAccept(List.of(MediaType.APPLICATION_JSON)); + + HttpEntity extensionEndpoint = new HttpEntity(extensionDetails.toString(), headers); + + //Act + ResponseEntity response = this.restTemplate.postForEntity("/cezen/add_extension", extensionEndpoint, String.class); + System.out.println(response.getBody()); + + ObjectMapper mapper = new ObjectMapper(); + ReturnStatus status = mapper.readValue(response.getBody(), ReturnStatus.class); + + //Assert + Assertions.assertFalse(status.status(), () -> "Wrong Status flag expected false in return "); + Assertions.assertEquals("Create Endpoint for NoEndPointEver", status.message(), () -> "Wrong message for given input"); + } + + @Test + @DisplayName("For no SIP endpoint Should return ReturnStatus object with false in it") + @Order(3) + public void extensionTest_addingANewExtension_StatusMessageMustReturnTrueInIt() throws JSONException, JsonProcessingException { + + //Act + ResponseEntity responseFromExtension = this.restTemplate.postForEntity("/cezen/add_extension", extensionEndpoint, String.class); + System.out.println(responseFromExtension.getBody()); + + ObjectMapper mapper = new ObjectMapper(); + ReturnStatus statusFromExtension = mapper.readValue(responseFromExtension.getBody(), ReturnStatus.class); + + //Assert + Assertions.assertTrue(statusFromExtension.status(), () -> "Wrong Status flag expected True in returnStatus first extension entry"); + Assertions.assertEquals("testEndpoint Persisted ", statusFromExtension.message(), () -> "Wrong message for given input"); + } + + @Test + @DisplayName("Duplicate entry of extension") + @Order(4) + public void extensionTest_addingANewExtension_StatusMessageMustReturnFalseInIt() throws JSONException, JsonProcessingException { + + //Act + ResponseEntity responseFromExtension = this.restTemplate.postForEntity("/cezen/add_extension", extensionEndpoint, String.class); + System.out.println(responseFromExtension.getBody()); + + ObjectMapper mapper = new ObjectMapper(); + ReturnStatus statusFromExtension = mapper.readValue(responseFromExtension.getBody(), ReturnStatus.class); + + //Assert + Assertions.assertFalse(statusFromExtension.status(), () -> "Wrong Status flag expected false in returnStatus for duplicate entry "); + Assertions.assertEquals("Data likely already exists or DB issue", statusFromExtension.message(), () -> "Wrong message for given input expected Data likely already exists or DB issue"); + } + + // delete the created testEndpoint value + @Test + @DisplayName("Delete an Extension with endpoint testEndpoint must return true") + @Order(5) + public void extensionTest_deletingAnExtension_ifExistsWillReturnTrue(){ + + // Arrange + String url = "/cezen/delete_extension?sipNumber=testEndPoint"; + + //Act + + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + + HttpEntity requestEntity = new HttpEntity<>(headers); + + ResponseEntity response = restTemplate.exchange( + url, + HttpMethod.DELETE, + requestEntity, + Boolean.class + ); + + // if the extension exists + Assertions.assertTrue(response.getBody()); + + response = restTemplate.exchange( + url, + HttpMethod.DELETE, + requestEntity, + Boolean.class + ); + + // when deleted it won't exist so the endpoint must return false + Assertions.assertFalse(response.getBody()); + } + + +}