mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-12-27 19:07:28 +00:00
fixed sonarqube returned error
This commit is contained in:
parent
61a14f4608
commit
88006a4304
4 changed files with 25 additions and 6 deletions
|
|
@ -20,6 +20,16 @@ services:
|
|||
- devops-net
|
||||
depends_on:
|
||||
- sonarqube
|
||||
postgres:
|
||||
image: postgres:16
|
||||
environment:
|
||||
POSTGRES_DB: petclinic
|
||||
POSTGRES_USER: petclinic
|
||||
POSTGRES_PASSWORD: petclinic
|
||||
ports:
|
||||
- "5432:5432"
|
||||
networks:
|
||||
- devops-net
|
||||
|
||||
sonarqube:
|
||||
image: sonarqube:lts-community
|
||||
|
|
|
|||
|
|
@ -60,8 +60,11 @@ class MySqlIntegrationTests {
|
|||
|
||||
@Test
|
||||
void testFindAll() {
|
||||
vets.findAll();
|
||||
vets.findAll(); // served from cache
|
||||
var firstCall = vets.findAll();
|
||||
assertThat(firstCall).isNotEmpty();
|
||||
|
||||
var secondCall = vets.findAll(); // served from cache
|
||||
assertThat(secondCall).hasSameSizeAs(firstCall);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -45,8 +45,11 @@ public class PetClinicIntegrationTests {
|
|||
|
||||
@Test
|
||||
void testFindAll() {
|
||||
vets.findAll();
|
||||
vets.findAll(); // served from cache
|
||||
var firstCall = vets.findAll();
|
||||
assertThat(firstCall).isNotEmpty();
|
||||
|
||||
var secondCall = vets.findAll(); // served from cache
|
||||
assertThat(secondCall).hasSameSizeAs(firstCall);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -80,8 +80,11 @@ public class PostgresIntegrationTests {
|
|||
|
||||
@Test
|
||||
void testFindAll() throws Exception {
|
||||
vets.findAll();
|
||||
vets.findAll(); // served from cache
|
||||
var firstCall = vets.findAll();
|
||||
assertThat(firstCall).isNotEmpty();
|
||||
|
||||
var secondCall = vets.findAll(); // served from cache
|
||||
assertThat(secondCall).hasSameSizeAs(firstCall);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue