@Test public void testFindAll() { List<Student> studentList = studentService.findAll(); assertNotNull(studentList); studentList.forEach(System.out::println); }
public List<Student> findAll() { System.out.printf("findAll Base URL: [%s]\n", baseUrl); RestTemplate restTemplate = new RestTemplate(); ResponseEntity<List<Student>> response = restTemplate.exchange( baseUrl, HttpMethod.GET, null, new ParameterizedTypeReference<List<Student>>(){}); List<Student> studentList = response.getBody(); return studentList; }
StudentService implements GenericService<Student, Long> { public List<Student> findAll() { System.out.printf("findAll Base URL: [%s]\n", baseUrl); RestTemplate restTemplate = new RestTemplate(); ResponseEntity<List<Student>> response = restTemplate.exchange( baseUrl, HttpMethod.GET, null, new ParameterizedTypeReference<List<Student>>(){}); List<Student> studentList = response.getBody(); return studentList; } }
StudentService implements GenericService<Student, Long> { public List<Student> findAll() { System.out.printf("findAll Base URL: [%s]\n", baseUrl); RestTemplate restTemplate = new RestTemplate(); ResponseEntity<List<Student>> response = restTemplate.exchange( baseUrl, HttpMethod.GET, null, new ParameterizedTypeReference<List<Student>>(){}); List<Student> studentList = response.getBody(); return studentList; } StudentService(StudentRepository studentRepository); }
StudentService implements GenericService<Student, Long> { public List<Student> findAll() { System.out.printf("findAll Base URL: [%s]\n", baseUrl); RestTemplate restTemplate = new RestTemplate(); ResponseEntity<List<Student>> response = restTemplate.exchange( baseUrl, HttpMethod.GET, null, new ParameterizedTypeReference<List<Student>>(){}); List<Student> studentList = response.getBody(); return studentList; } StudentService(StudentRepository studentRepository); Student findById(Long id); List<Student> findAll(); Student save(Student student); void delete(Student student); }
StudentService implements GenericService<Student, Long> { public List<Student> findAll() { System.out.printf("findAll Base URL: [%s]\n", baseUrl); RestTemplate restTemplate = new RestTemplate(); ResponseEntity<List<Student>> response = restTemplate.exchange( baseUrl, HttpMethod.GET, null, new ParameterizedTypeReference<List<Student>>(){}); List<Student> studentList = response.getBody(); return studentList; } StudentService(StudentRepository studentRepository); Student findById(Long id); List<Student> findAll(); Student save(Student student); void delete(Student student);  }