Removed unnecessary semicolons (#998)

This commit is contained in:
Shweta Tyagi 2022-08-22 14:53:03 +04:00 committed by Dave Syer
parent a3294f2df7
commit c5763046dd
4 changed files with 7 additions and 11 deletions

View file

@ -34,9 +34,7 @@ class CacheConfiguration {
@Bean @Bean
public JCacheManagerCustomizer petclinicCacheConfigurationCustomizer() { public JCacheManagerCustomizer petclinicCacheConfigurationCustomizer() {
return cm -> { return cm -> cm.createCache("vets", cacheConfiguration());
cm.createCache("vets", cacheConfiguration());
};
} }
/** /**

View file

@ -35,10 +35,10 @@ import org.springframework.web.bind.annotation.ResponseBody;
@Controller @Controller
class VetController { class VetController {
private final VetRepository vets; private final VetRepository vetRepository;
public VetController(VetRepository clinicService) { public VetController(VetRepository clinicService) {
this.vets = clinicService; this.vetRepository = clinicService;
} }
@GetMapping("/vets.html") @GetMapping("/vets.html")
@ -64,7 +64,7 @@ class VetController {
private Page<Vet> findPaginated(int page) { private Page<Vet> findPaginated(int page) {
int pageSize = 5; int pageSize = 5;
Pageable pageable = PageRequest.of(page - 1, pageSize); Pageable pageable = PageRequest.of(page - 1, pageSize);
return vets.findAll(pageable); return vetRepository.findAll(pageable);
} }
@GetMapping({ "/vets" }) @GetMapping({ "/vets" })
@ -72,7 +72,7 @@ class VetController {
// Here we are returning an object of type 'Vets' rather than a collection of Vet // Here we are returning an object of type 'Vets' rather than a collection of Vet
// objects so it is simpler for JSon/Object mapping // objects so it is simpler for JSon/Object mapping
Vets vets = new Vets(); Vets vets = new Vets();
vets.getVetList().addAll(this.vets.findAll()); vets.getVetList().addAll(this.vetRepository.findAll());
return vets; return vets;
} }

View file

@ -55,6 +55,4 @@ public interface VetRepository extends Repository<Vet, Integer> {
@Cacheable("vets") @Cacheable("vets")
Page<Vet> findAll(Pageable pageable) throws DataAccessException; Page<Vet> findAll(Pageable pageable) throws DataAccessException;
;
} }

View file

@ -53,7 +53,7 @@ class VetControllerTests {
james.setLastName("Carter"); james.setLastName("Carter");
james.setId(1); james.setId(1);
return james; return james;
}; }
private Vet helen() { private Vet helen() {
Vet helen = new Vet(); Vet helen = new Vet();
@ -65,7 +65,7 @@ class VetControllerTests {
radiology.setName("radiology"); radiology.setName("radiology");
helen.addSpecialty(radiology); helen.addSpecialty(radiology);
return helen; return helen;
}; }
@BeforeEach @BeforeEach
void setup() { void setup() {