diff --git a/spring/pom.xml b/spring/pom.xml index 1b16635c..454e5b22 100644 --- a/spring/pom.xml +++ b/spring/pom.xml @@ -65,6 +65,7 @@ junit5-spring-boot-3-test + testng-spring-boot-3-test diff --git a/spring/testng-spring-boot-3-test/pom.xml b/spring/testng-spring-boot-3-test/pom.xml new file mode 100644 index 00000000..68851dd5 --- /dev/null +++ b/spring/testng-spring-boot-3-test/pom.xml @@ -0,0 +1,159 @@ + + + + + + + org.quickperf + quick-perf-spring + 1.1.1-SNAPSHOT + + + 4.0.0 + + quick-perf-testng-spring-boot-3-test + + + 17 + 17 + 17 + true + true + true + true + + + + + + org.springframework.boot + spring-boot-dependencies + 3.2.5 + pom + import + + + + + + + + org.testng + testng + 7.8.0 + test + + + + org.quickperf + quick-perf-testng-sql-listener + 1.1.1-SNAPSHOT + test + + + + org.quickperf + quick-perf-testng-test-util + 1.1.1-SNAPSHOT + tests + test-jar + test + + + + org.quickperf + quick-perf-springboot2-sql-starter + 1.1.1-SNAPSHOT + test + + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-logging + + + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.jupiter + junit-jupiter + + + org.junit.platform + junit-platform-launcher + + + org.junit.platform + junit-platform-engine + + + org.mockito + mockito-junit-jupiter + + + + + + org.springframework.boot + spring-boot-starter-log4j2 + + + + com.h2database + h2 + runtime + + + + + + + + maven-jar-plugin + ${maven-jar-plugin.version} + + + default-jar + none + + + + + maven-surefire-plugin + 3.2.5 + + none + + + + + + diff --git a/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/FootballApplication.java b/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/FootballApplication.java new file mode 100644 index 00000000..157aaf65 --- /dev/null +++ b/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/FootballApplication.java @@ -0,0 +1,25 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2019-2022 the original author or authors. + */ +package org.quickperf.spring.testngspringboottest; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class FootballApplication { + + public static void main(String[] args) { + SpringApplication.run(FootballApplication.class, args); + } + +} diff --git a/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/controller/PlayerController.java b/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/controller/PlayerController.java new file mode 100644 index 00000000..3d498fb7 --- /dev/null +++ b/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/controller/PlayerController.java @@ -0,0 +1,34 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2019-2022 the original author or authors. + */ +package org.quickperf.spring.testngspringboottest.controller; + +import org.quickperf.spring.testngspringboottest.dto.PlayerWithTeamName; +import org.quickperf.spring.testngspringboottest.service.PlayerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +public class PlayerController { + + @Autowired + private PlayerService playerService; + + @GetMapping("/players") + public List findAll() { + return playerService.findPlayersWithTeamName(); + } + +} diff --git a/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/dto/PlayerWithTeamName.java b/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/dto/PlayerWithTeamName.java new file mode 100644 index 00000000..31932117 --- /dev/null +++ b/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/dto/PlayerWithTeamName.java @@ -0,0 +1,18 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2019-2022 the original author or authors. + */ +package org.quickperf.spring.testngspringboottest.dto; + +import java.io.Serializable; + +public record PlayerWithTeamName(String firstName, String lastName, String team) implements Serializable { +} diff --git a/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/jpa/entity/Player.java b/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/jpa/entity/Player.java new file mode 100644 index 00000000..43a30e60 --- /dev/null +++ b/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/jpa/entity/Player.java @@ -0,0 +1,65 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2019-2022 the original author or authors. + */ +package org.quickperf.spring.testngspringboottest.jpa.entity; + +import jakarta.persistence.*; +import java.io.Serializable; + +@Entity +public class Player implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String firstName; + + private String lastName; + + @ManyToOne(fetch = FetchType.LAZY, targetEntity = Team.class) + @JoinColumn(name = "team_id") + private Team team; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public Team getTeam() { + return team; + } + + public void setTeam(Team team) { + this.team = team; + } + +} diff --git a/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/jpa/entity/Team.java b/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/jpa/entity/Team.java new file mode 100644 index 00000000..90eccdd1 --- /dev/null +++ b/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/jpa/entity/Team.java @@ -0,0 +1,46 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2019-2022 the original author or authors. + */ +package org.quickperf.spring.testngspringboottest.jpa.entity; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import java.io.Serializable; + +@Entity +public class Team implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE) + private Long id; + + private String name; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/jpa/repository/PlayerRepository.java b/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/jpa/repository/PlayerRepository.java new file mode 100644 index 00000000..bba95a0a --- /dev/null +++ b/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/jpa/repository/PlayerRepository.java @@ -0,0 +1,26 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2019-2022 the original author or authors. + */ +package org.quickperf.spring.testngspringboottest.jpa.repository; + +import org.quickperf.spring.testngspringboottest.jpa.entity.Player; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface PlayerRepository extends JpaRepository { + + List findAll(); + +} diff --git a/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/service/PlayerService.java b/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/service/PlayerService.java new file mode 100644 index 00000000..3d6103d0 --- /dev/null +++ b/spring/testng-spring-boot-3-test/src/main/java/org/quickperf/spring/testngspringboottest/service/PlayerService.java @@ -0,0 +1,47 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2019-2022 the original author or authors. + */ +package org.quickperf.spring.testngspringboottest.service; + +import org.quickperf.spring.testngspringboottest.dto.PlayerWithTeamName; +import org.quickperf.spring.testngspringboottest.jpa.entity.Player; +import org.quickperf.spring.testngspringboottest.jpa.repository.PlayerRepository; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class PlayerService { + + private final PlayerRepository playerRepository; + + public PlayerService(PlayerRepository playerRepository) { + this.playerRepository = playerRepository; + } + + @Transactional(readOnly = true) + public List findPlayersWithTeamName() { + List players = playerRepository.findAll(); + return players + .stream() + .map(player -> new PlayerWithTeamName( + player.getFirstName() + , player.getLastName() + , player.getTeam().getName() + ) + ) + .collect(Collectors.toList()); + } + +} diff --git a/spring/testng-spring-boot-3-test/src/test/java/org/quickperf/spring/testngspringboottest/SpringBootExpectSelectTestNGTest.java b/spring/testng-spring-boot-3-test/src/test/java/org/quickperf/spring/testngspringboottest/SpringBootExpectSelectTestNGTest.java new file mode 100644 index 00000000..08974fc3 --- /dev/null +++ b/spring/testng-spring-boot-3-test/src/test/java/org/quickperf/spring/testngspringboottest/SpringBootExpectSelectTestNGTest.java @@ -0,0 +1,45 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2019-2022 the original author or authors. + */ +package org.quickperf.spring.testngspringboottest; + +import org.quickperf.spring.testngspringboottest.service.DetectionOfNPlusOneSelectInServiceWithExpectSelect; +import org.quickperf.testng.TestNGTests; +import org.testng.annotations.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +public class SpringBootExpectSelectTestNGTest { + + @Test + public void should_fail_if_select_number_is_greater_than_expected_from_spring_service() { + + // GIVEN + Class testClass = DetectionOfNPlusOneSelectInServiceWithExpectSelect.class; + TestNGTests testNGTests = TestNGTests.createInstance(testClass); + + // WHEN + TestNGTests.TestNGTestsResult testsResult = testNGTests.run(); + + // THEN + assertThat(testsResult.getNumberOfFailedTest()).isOne(); + + Throwable errorReport = testsResult.getThrowableOfFirstTest(); + assertThat(errorReport) + .hasMessageContaining("You may think that <1> select statement was sent to the database") + .hasMessageContaining("Perhaps you are facing an N+1 select issue") + .hasMessageContaining("With Hibernate, you may fix it by") + .hasMessageContaining("With Spring Data JPA, you may fix it by"); + + } + +} diff --git a/spring/testng-spring-boot-3-test/src/test/java/org/quickperf/spring/testngspringboottest/SpringBootMockMvcTestNGTest.java b/spring/testng-spring-boot-3-test/src/test/java/org/quickperf/spring/testngspringboottest/SpringBootMockMvcTestNGTest.java new file mode 100644 index 00000000..f368dbb0 --- /dev/null +++ b/spring/testng-spring-boot-3-test/src/test/java/org/quickperf/spring/testngspringboottest/SpringBootMockMvcTestNGTest.java @@ -0,0 +1,43 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2019-2022 the original author or authors. + */ +package org.quickperf.spring.testngspringboottest; + +import org.quickperf.spring.testngspringboottest.mockmvc.DetectionOfNPlusOneSelectWithMockMvc; +import org.quickperf.testng.TestNGTests; +import org.testng.annotations.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +public class SpringBootMockMvcTestNGTest { + + @Test + public void should_fail_if_select_number_is_greater_than_expected_with_mock_mvc() { + + // GIVEN + Class testClass = DetectionOfNPlusOneSelectWithMockMvc.class; + TestNGTests testNGTests = TestNGTests.createInstance(testClass); + + // WHEN + TestNGTests.TestNGTestsResult testsResult = testNGTests.run(); + + // THEN + assertThat(testsResult.getNumberOfFailedTest()).isOne(); + + Throwable errorReport = testsResult.getThrowableOfFirstTest(); + assertThat(errorReport) + .hasMessageContaining("You may think that <1> select statement was sent to the database") + .hasMessageContaining("Perhaps you are facing an N+1 select issue"); + + } + +} diff --git a/spring/testng-spring-boot-3-test/src/test/java/org/quickperf/spring/testngspringboottest/mockmvc/DetectionOfNPlusOneSelectWithMockMvc.java b/spring/testng-spring-boot-3-test/src/test/java/org/quickperf/spring/testngspringboottest/mockmvc/DetectionOfNPlusOneSelectWithMockMvc.java new file mode 100644 index 00000000..8365ee8d --- /dev/null +++ b/spring/testng-spring-boot-3-test/src/test/java/org/quickperf/spring/testngspringboottest/mockmvc/DetectionOfNPlusOneSelectWithMockMvc.java @@ -0,0 +1,44 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2019-2022 the original author or authors. + */ +package org.quickperf.spring.testngspringboottest.mockmvc; + +import org.quickperf.spring.testngspringboottest.FootballApplication; +import org.quickperf.sql.annotation.ExpectSelect; +import org.quickperf.testng.QuickPerfSqlTestNGListener; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; +import org.springframework.test.web.servlet.MockMvc; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@SpringBootTest(classes = {FootballApplication.class}) +@AutoConfigureMockMvc +@Listeners(QuickPerfSqlTestNGListener.class) +public class DetectionOfNPlusOneSelectWithMockMvc extends AbstractTestNGSpringContextTests { + + @Autowired + private MockMvc mockMvc; + + @ExpectSelect(1) + @Test + public void should_find_all_players() throws Exception { + mockMvc.perform(get("/players")) + .andExpect(status().isOk()); + } + +} diff --git a/spring/testng-spring-boot-3-test/src/test/java/org/quickperf/spring/testngspringboottest/service/DetectionOfNPlusOneSelectInServiceWithExpectSelect.java b/spring/testng-spring-boot-3-test/src/test/java/org/quickperf/spring/testngspringboottest/service/DetectionOfNPlusOneSelectInServiceWithExpectSelect.java new file mode 100644 index 00000000..46c1531a --- /dev/null +++ b/spring/testng-spring-boot-3-test/src/test/java/org/quickperf/spring/testngspringboottest/service/DetectionOfNPlusOneSelectInServiceWithExpectSelect.java @@ -0,0 +1,46 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2019-2022 the original author or authors. + */ +package org.quickperf.spring.testngspringboottest.service; + +import org.quickperf.spring.testngspringboottest.FootballApplication; +import org.quickperf.spring.testngspringboottest.dto.PlayerWithTeamName; +import org.quickperf.sql.annotation.ExpectSelect; +import org.quickperf.testng.QuickPerfSqlTestNGListener; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; + +@SpringBootTest(classes = {FootballApplication.class}) +@Listeners(QuickPerfSqlTestNGListener.class) +public class DetectionOfNPlusOneSelectInServiceWithExpectSelect extends AbstractTestNGSpringContextTests { + + @Autowired + private PlayerService playerService; + + @ExpectSelect(1) + @Test + public void should_find_all_players_with_team_name() { + + List playersWithTeamName = playerService.findPlayersWithTeamName(); + + assertThat(playersWithTeamName).hasSize(2); + + } + +} diff --git a/spring/testng-spring-boot-3-test/src/test/resources/application.properties b/spring/testng-spring-boot-3-test/src/test/resources/application.properties new file mode 100644 index 00000000..5db782e9 --- /dev/null +++ b/spring/testng-spring-boot-3-test/src/test/resources/application.properties @@ -0,0 +1,24 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# Copyright 2019-2022 the original author or authors. +# + +spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1 +spring.datasource.driverClassName=org.h2.Driver + +spring.jpa.open-in-view=false +spring.jpa.hibernate.ddl-auto=create-drop + +spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl + +logging.level.org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl=ERROR + +spring.main.banner-mode=off diff --git a/spring/testng-spring-boot-3-test/src/test/resources/import.sql b/spring/testng-spring-boot-3-test/src/test/resources/import.sql new file mode 100644 index 00000000..afc9f114 --- /dev/null +++ b/spring/testng-spring-boot-3-test/src/test/resources/import.sql @@ -0,0 +1,18 @@ +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +-- the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +-- an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations under the License. +-- +-- Copyright 2019-2022 the original author or authors. +-- + +INSERT INTO Team (id, name) VALUES (1, 'Manchester United'); +INSERT INTO Team (id, name) VALUES (2, 'Atlético de Madrid'); + +INSERT INTO Player (id, firstName, lastName, team_id) VALUES (1, 'Paul', 'Pogba', 1); +INSERT INTO Player (id, firstName, lastName, team_id) VALUES (2, 'Antoine', 'Griezmann', 2); diff --git a/spring/testng-spring-boot-3-test/src/test/resources/log4j2.xml b/spring/testng-spring-boot-3-test/src/test/resources/log4j2.xml new file mode 100644 index 00000000..0f6d51c8 --- /dev/null +++ b/spring/testng-spring-boot-3-test/src/test/resources/log4j2.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + +