mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 20:25:50 +00:00
Removed unnecessary semicolons (#998)
This commit is contained in:
parent
a3294f2df7
commit
c5763046dd
4 changed files with 7 additions and 11 deletions
|
@ -34,9 +34,7 @@ class CacheConfiguration {
|
|||
|
||||
@Bean
|
||||
public JCacheManagerCustomizer petclinicCacheConfigurationCustomizer() {
|
||||
return cm -> {
|
||||
cm.createCache("vets", cacheConfiguration());
|
||||
};
|
||||
return cm -> cm.createCache("vets", cacheConfiguration());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -35,10 +35,10 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
@Controller
|
||||
class VetController {
|
||||
|
||||
private final VetRepository vets;
|
||||
private final VetRepository vetRepository;
|
||||
|
||||
public VetController(VetRepository clinicService) {
|
||||
this.vets = clinicService;
|
||||
this.vetRepository = clinicService;
|
||||
}
|
||||
|
||||
@GetMapping("/vets.html")
|
||||
|
@ -64,7 +64,7 @@ class VetController {
|
|||
private Page<Vet> findPaginated(int page) {
|
||||
int pageSize = 5;
|
||||
Pageable pageable = PageRequest.of(page - 1, pageSize);
|
||||
return vets.findAll(pageable);
|
||||
return vetRepository.findAll(pageable);
|
||||
}
|
||||
|
||||
@GetMapping({ "/vets" })
|
||||
|
@ -72,7 +72,7 @@ class VetController {
|
|||
// Here we are returning an object of type 'Vets' rather than a collection of Vet
|
||||
// objects so it is simpler for JSon/Object mapping
|
||||
Vets vets = new Vets();
|
||||
vets.getVetList().addAll(this.vets.findAll());
|
||||
vets.getVetList().addAll(this.vetRepository.findAll());
|
||||
return vets;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,6 +55,4 @@ public interface VetRepository extends Repository<Vet, Integer> {
|
|||
@Cacheable("vets")
|
||||
Page<Vet> findAll(Pageable pageable) throws DataAccessException;
|
||||
|
||||
;
|
||||
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ class VetControllerTests {
|
|||
james.setLastName("Carter");
|
||||
james.setId(1);
|
||||
return james;
|
||||
};
|
||||
}
|
||||
|
||||
private Vet helen() {
|
||||
Vet helen = new Vet();
|
||||
|
@ -65,7 +65,7 @@ class VetControllerTests {
|
|||
radiology.setName("radiology");
|
||||
helen.addSpecialty(radiology);
|
||||
return helen;
|
||||
};
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
void setup() {
|
||||
|
|
Loading…
Reference in a new issue