fixed sonarqube returned error

This commit is contained in:
Yuxin Deng 2025-11-23 21:28:11 -05:00
parent 61a14f4608
commit 88006a4304
4 changed files with 25 additions and 6 deletions

View file

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

View file

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

View file

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

View file

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