I’m facing a null error when I attempt to retrieve data from the repository. How do I update this test to resolve the null error?
java.lang.NullPointerException: Cannot invoke "StudentSystemRepository.getLimitedStudentPayerList()" because "this.StudentSystemRepository" is null
@SpringBootTest
@DataJpaTest
public class TestStudentLog {
@Autowired
private StudentSystemRepository StudentSystemRepository;
@Test
public void testGetLimitedStudentPayersList() {
// Call the method to retrieve the list of limited Student payers
List<StudentPayer> limitedStudentPayers = StudentSystemRepository.getLimitedStudentPayerList();
System.out.println(limitedStudentPayers);
}
}