title: How to test DELETE method in Spring boot using Mockito and JUnit
body: <p>In Spring boot framework, I'm finding a difficulty with the controller Unit testing using JUnit and Mockito. I want to test this method. How to test DELETE Request method:</p>
  
  <p>// delete application
  <strong>Controller class</strong></p>
  
  <pre><code>    @DeleteMapping("/applications")
      public String deleteApplicationByObject(@RequestBody Application application) {
          applicationService.deleteById(application.getId());
          return "Deleted";
      }
  </code></pre>
  
  <p>// delete application
  <strong>Service class</strong></p>
  
  <pre><code>    @Override
      @Transactional
      public String removeById(Long id) {
          dao.deleteById(id);
          return "SUCCESS";
      }
  </code></pre>
  
  <p>// delete application
  <strong>Dao class</strong></p>
  
  <pre><code>    @Override
      public void deleteById(Long id) {
          Application application = findById(id);
          em.remove(application);
      }
  </code></pre>
  
  <p>Thank you in advance.</p>