0PricingLogin
Testing Mastery: JUnit, Mockito & Integration Tests · Lesson

Setting Up Integration Tests

Configure your project to support integration tests, including managing test environments and dependencies.

Integration Test Setup Intro

Welcome to setting up Integration Tests! After learning about the difference between unit and integration tests, it's time to prepare our project.

Proper setup is crucial for integration tests to run reliably. It ensures your tests are isolated, repeatable, and don't interfere with your development environment.

Separate Source Folders

The first step is to clearly separate your integration tests from your unit tests. This helps organize your codebase and allows build tools to treat them differently.

  • Unit Tests: Typically reside in src/test/java.
  • Integration Tests: Often placed in a dedicated folder like src/it/java or src/integrationTest/java.

This separation makes it easier to run them at different stages of your build process.

All lessons in this course

  1. Unit vs. Integration Tests
  2. Setting Up Integration Tests
  3. Testing Database Interactions
  4. Testing External APIs with WireMock
← Back to Testing Mastery: JUnit, Mockito & Integration Tests