How xbyxr9/ise-exam-drills works
Purpose and Build Model
This is a Java 17 Gradle training repository for exam-style JUnit, EasyMock, and Spring REST exercises. It is not one application: it combines isolated domain scenarios, three independently runnable REST servers, and a mutation drill that verifies tests fail against broken implementations. Build orchestration and custom server/report tasks reside in build.gradle; the Gradle wrapper is gradlew.
Entry Points and Execution
The main runnable REST applications are:
• Product server, port 8080: src/main/java/ise/rest/server/ServerApplication.java
• Pullover exam server, port 8081: src/main/java/ise/rest/exam_pullover/PulloverServerApplication.java
• Practice server, port 8082: src/main/java/ise/rest/practice/PracticeServerApplication.java
Use Gradle tasks rather than a single universal main class. The legacy src/Main.java is explicitly not part of the maintained Gradle structure.
Testing Curriculum Domains
The repository’s dominant structure is independent, progressively numbered scenarios rather than a shared business system:
• JUnit/domain-testing exercises: src/main/java/ise/testing/, exemplified by src/main/java/ise/testing/s12_voidstate/ClubRegistry.java and src/main/java/ise/testing/exam_library/Library.java.
• EasyMock interaction-testing exercises: src/main/java/ise/mocking/, including src/main/java/ise/mocking/s12_callorder/AirlockController.java and src/main/java/ise/mocking/exam_vehicle/VehicleManagementSystem.java.
• Each scenario defines a small SUT with explicit collaborator seams, allowing tests to verify state, exceptions, returned values, call counts, ordering, and forbidden calls.
REST Service Architecture
Each REST variant follows a conventional controller/resource → service → repository boundary:
• Product API: src/main/java/ise/rest/server/ProductResource.java, src/main/java/ise/rest/server/ProductService.java, src/main/java/ise/rest/server/ProductRepository.java.
• Pullover stock API: src/main/java/ise/rest/exam_pullover/PulloverStockResource.java, src/main/java/ise/rest/exam_pullover/PulloverStockService.java, src/main/java/ise/rest/exam_pullover/PulloverStockRepository.java.
• Practice stock API mirrors that shape in src/main/java/ise/rest/practice/PracticeStockResource.java.
HTTP requests enter Spring MVC resources, are delegated to service logic, then query/update repository abstractions. Shared REST value types, including products, reviews, and sorting inputs, are under src/main/java/ise/rest/model/.
Client and External Boundaries
The REST client boundary is represented by src/main/java/ise/rest/client/ProductController.java, with endpoint/client behavior tested separately. Mocking scenarios model external services as interfaces/collaborators—such as gateways, mail, shipping, storage, and hardware—rather than integrating real providers; e.g., src/main/java/ise/mocking/s08_exceptions/CardProcessor.java and src/main/java/ise/mocking/s13_multiplemocks/CourierApi.java.
Mutation Verification Control Flow
The mutation drill is a meta-test layer: deliberately broken implementations under src/test/java/ise/mutants/ are executed programmatically by src/test/java/ise/drill/MutationDrillTest.java. Normal tests exclude the mutant tag, while the drill requires every mutant test to fail. Thus the green suite validates both application behavior and the ability of its tests to detect regressions.
Runtime and Infrastructure
Compilation targets Java 17 through Gradle 8.14.5. Spring Boot 3.2.5 libraries provide MVC, WebFlux, testing, and the three embedded HTTP servers, without applying the Spring Boot Gradle plugin. JUnit Jupiter 5.10.2 powers tests; EasyMock 5.2.0 is the intended mocking framework; the JUnit Platform Launcher supports mutation-drill execution.
Main entry points: build.gradle Gradle build & tasks · ProductResource.java Product resource · AirlockController.java Airlock controller · VehicleManagementSystem.java Vehicle management
Components 23
Build & Runtime
- Gradle build & tasks · Build orchestration and custom server/report tasks.
build.gradle - Gradle wrapper
gradlew
Testing Curriculum
- JUnit domain scenarios · Independent state, exception, and return-value testing scenarios.
- Club registry scenario
src/main/java/ise/testing/s12_voidstate/ClubRegistry.java - Library exam scenario
src/main/java/ise/testing/exam_library/Library.java - EasyMock scenarios · SUTs use collaborator seams for interaction assertions.
- Airlock controller
src/main/java/ise/mocking/s12_callorder/AirlockController.java - Vehicle management
src/main/java/ise/mocking/exam_vehicle/VehicleManagementSystem.java - External collaborators · Gateways, mail, shipping, storage, and hardware are mocked.
src/main/java/ise/mocking/s08_exceptions/CardProcessor.java
Product REST · 8080
- Product server · Embedded server on port 8080.
src/main/java/ise/rest/server/ServerApplication.java - Product resource
src/main/java/ise/rest/server/ProductResource.java - Product service
src/main/java/ise/rest/server/ProductService.java - Product repository
src/main/java/ise/rest/server/ProductRepository.java - Shared REST models · Products, reviews, and sorting inputs.
- Product client controller · Separately tested endpoint/client boundary.
src/main/java/ise/rest/client/ProductController.java
Pullover REST · 8081
- Pullover server · Embedded server on port 8081.
src/main/java/ise/rest/exam_pullover/PulloverServerApplication.java - Pullover stock resource
src/main/java/ise/rest/exam_pullover/PulloverStockResource.java - Pullover stock service
src/main/java/ise/rest/exam_pullover/PulloverStockService.java - Pullover stock repository
src/main/java/ise/rest/exam_pullover/PulloverStockRepository.java
Practice REST · 8082
- Practice server · Embedded server on port 8082.
src/main/java/ise/rest/practice/PracticeServerApplication.java - Practice stock resource
src/main/java/ise/rest/practice/PracticeStockResource.java
Mutation Verification
- Mutation drill · Runs mutant implementations and requires their tests to fail.
src/test/java/ise/drill/MutationDrillTest.java - Broken implementations
Connections 21
- Gradle wrapper → Gradle build & tasks: invokes
- Gradle build & tasks → Product server: runs task
- Gradle build & tasks → Pullover server: runs task
- Gradle build & tasks → Practice server: runs task
- JUnit domain scenarios → Club registry scenario: contains
- JUnit domain scenarios → Library exam scenario: contains
- EasyMock scenarios → Airlock controller: contains
- EasyMock scenarios → Vehicle management: contains
- Airlock controller → External collaborators: mocked calls
- Vehicle management → External collaborators: mocked calls
- Product server → Product resource: serves HTTP
- Product resource → Product service: delegates
- Product service → Product repository: queries/updates
- Product resource → Shared REST models: uses
- Product client controller → Product resource: calls endpoints
- Pullover server → Pullover stock resource: serves HTTP
- Pullover stock resource → Pullover stock service: delegates
- Pullover stock service → Pullover stock repository: queries/updates
- Practice server → Practice stock resource: serves HTTP
- Mutation drill → Broken implementations: executes
- Gradle build & tasks → Mutation drill: runs tests