title: Unit test for Save method of JPA Repository in Spring Boot
body: <p>Can you please tell me how I should write unit tests for this code using Mockito &amp; JUnit? StudentRepository is an interface which extends JPA Repository.</p>
  <pre><code>public class StudentService {
      @Autowired
      StudentRepository studentRepository;
      
      public void saveStudentDetails(StudentModel student) {
          Student stud = new Student();
          stud.setStudentId(student.getStudentId());
          stud.setStudentName(student.getStudentName());
          studentRepository.save(stud);
      }
  }
  </code></pre>