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
public JCacheManagerCustomizer petclinicCacheConfigurationCustomizer() {
return cm -> {
cm.createCache("vets", cacheConfiguration());
};
return cm -> cm.createCache("vets", cacheConfiguration());
}
/**

View file

@ -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;
}

View file

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

View file

@ -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() {