Can you please tell me how I should write unit tests for this code using Mockito & JUnit? StudentRepository is an interface which extends JPA Repository.
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);
}
}