Skip to content

Repository focused on the study and practice of Java unit testing using JUnit 5. Includes layered architecture with services and DAOs, mock implementations, assertions, and examples of filtering and failure testing.

Notifications You must be signed in to change notification settings

AsrielDreemurrGM/Study_Of_Java_Unit_Tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Study Of Java Unit Tests

Repository focused on the study and practice of Java unit testing using the JUnit 5 framework.
Includes practical examples of assertions, layered architecture with services and DAOs, and integration with code coverage tools like EclEmma. Made using Spring Tools Suite 4.

πŸ” Covered Concepts

  • Project structure for unit testing (src/main/java and src/test/java);
  • Basic unit tests using assertEquals and assertNotEquals;
  • Tests for business logic through service and DAO abstraction layers;
  • Use of Mock implementations to simulate success and failure scenarios;
  • Filtering logic validation through unit tests (FilterByGenderTest);
  • Code coverage analysis using EclEmma plugin (Eclipse);
  • Javadoc and inline comments included for clarity.

πŸ—‚οΈ Project Structure

  • br.com.eaugusto: Contains ClientTest and its unit test TestClientTest;
  • br.com.eaugusto.coursetask: Contains Person, FilterByGender, and related tests;
  • br.com.eaugusto.mocks.dao / service: DAO and service layer interfaces and mock implementations for Client testing;
  • br.com.eaugusto.mockstests.service: Unit tests for client service behavior (success/failure);
  • br.com.eaugusto.contract.dao / service: Interface definitions and mock/realistic DAO implementations for Contract logic;
  • br.com.eaugusto.contracttests: Contains ContractServiceTest, testing all contract-related functionality.

πŸš€ How to Run

  1. Clone this repository;
  2. Import into an IDE that supports JUnit 5 (e.g., Eclipse with EclEmma, IntelliJ);
  3. Run test classes (e.g., FirstTest, TestClientTest, ClientServiceTest, ContractServiceTest);
  4. Use EclEmma to verify test coverage and validate implementation.

πŸ“… Commit Highlights

June 20, 2025

  • Added search, delete, and edit methods to ContractService, with full unit test coverage.
  • Created service and DAO layers for Contract, including mock and exception-based implementations.
  • Developed ClientService and corresponding unit tests with dependency injection and mock DAO use.

June 19, 2025

  • Added FilterByGenderTest to check gender-based filtering accuracy;
  • Created FilterByGender and Person in the coursetask package with parsing logic;
  • Implemented ClientTest and TestClientTest with basic structure and coverage;
  • Initialized the project with FirstTest and integrated JUnit 5 and EclEmma.

πŸ“š Learning Goals

  • Understand and structure Java projects with unit testing and test source folders;
  • Learn to write assertions using JUnit 5 and analyze code behavior through testing;
  • Practice service and DAO patterns with mock implementations and exception handling;
  • Use test coverage tools to ensure testing effectiveness and code reliability.

About

Repository focused on the study and practice of Java unit testing using JUnit 5. Includes layered architecture with services and DAOs, mock implementations, assertions, and examples of filtering and failure testing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages