About 3,690,000 results
Open links in new tab
  1. DB Integration Tests with Spring Boot and Testcontainers

    Jan 8, 2024 · In this tutorial, we’ll demonstrate how to use Testcontainers for integration testing with Spring Data JPA and the PostgreSQL database. In our previous tutorial, we created some …

  2. Spring boot and Database testing with connection pool

    Aug 31, 2016 · The getConnection acquires connection from underlying pool. Change your tests to properly close the acquired connection like so: @Test public void test1() throws …

  3. Setting Up H2 for Testing in Spring Boot | by Paul Kunda - Medium

    Jun 29, 2023 · In this article, I will show you how to use H2 for unit testing and integration testing, using different application properties for testing and production app. We will create a simple API...

  4. Unit Testing in Spring Boot Project using Mockito and Junit

    Jan 2, 2025 · So, in this article, we are going to perform Unit Testing in Spring Boot Project using Mockito and JUnit. Annotations: @Mock: This annotation is used when we have to create and …

  5. How to Unit Test a Spring Boot Application - HowToDoInJava

    Aug 18, 2023 · Learn to write unit tests and integration tests in spring boot applications along with spring context, test annotations and mock support.

  6. Database Integration Tests With Spring Boot and Testcontainers

    May 31, 2023 · In this tutorial, we'll show you how to use Testcontainers for integration testing with Spring Data JPA and a PostgreSQL database. We will be testing JPQL and native SQL …

  7. Configuring Separate Spring DataSource for Tests - Baeldung

    Mar 26, 2025 · In this quick tutorial, we’ll learn several ways to configure a separate data source for testing in Spring. 2. Maven Dependencies. We’re going to create a Spring Boot application …

  8. how can I connect to my database with spring and test it?

    Sep 6, 2015 · I am trying to create a connection for my spring project, soemthing very simple. I want to create the configuration fields on my application.properties. I tried with the …

  9. How to Mock a Database Connection for Testing in Spring Boot?

    Mocking a database connection in Spring Boot is essential for unit testing components that interact with the database without requiring the actual database. This approach uses mocking …

  10. Testing in Spring Boot - Baeldung

    Jan 8, 2024 · In this tutorial, we’ll have a look at writing tests using the framework support in Spring Boot. We’ll cover unit tests that can run in isolation as well as integration tests that will …

  11. Some results have been removed
Refresh