A hands-on learning project exploring Java 8+ features through practical, real-world examples.
Topics covered: Optional, Function (Functional Interface), JUnit 5 tagging, and CI/CD basics.
See docs/WHAT_IS_IT.md for a full overview of the project goals and structure.
src/
βββ main/java/
β βββ functionalInterface/function/myimpl/ β Function<T,R> interface demo
β βββ optionaldemoone/ β Optional with real-world domain objects
β βββ jenkins/ β CI/CD placeholder
βββ test/java/
βββ junitdemo/ β JUnit 5 Tags & Display Names
βββ optionaldemoone/ β Tests for DiscountService
βββ optionaldemoWithPerson/ β Optional stream scenarios
| Guide | Description |
|---|---|
| docs/WHAT_IS_IT.md | Project overview and learning goals |
| docs/optional-guide.md | Deep dive into Java Optional |
| docs/advanced-optional-scenarios-explained.md | Advanced Optional patterns explained in depth |
| docs/functional-interface-function-guide.md | Function<T,R>, andThen, compose |
| docs/junit5-tagging-guide.md | JUnit 5 @Tag, @DisplayName, selective test runs |
| docs/java21-modern-java-guide.md | Java 21 features used in this project |
| docs/github-actions-guide.md | GitHub Actions explained for beginners |
| docs/github-actions-advanced-guide.md | Advanced GitHub Actions β concurrency, secrets, matrix, artifacts, reusable workflows |
- Java 21+
- Maven 3.6+
mvn test# Run integration tests only
mvn test -Dgroups="integration"
# Run unit tests only
mvn test -Dgroups="ecomm-unit-tests"
# Run sanity tests only
mvn test -Dgroups="ecomm-sanity"
# Run Optional demo tests
mvn test -Dgroups="Rel1"mvn test -DinParameter=MyValue| Workflow | Trigger | What it runs |
|---|---|---|
| CI β Build & Test All | Auto on every push & PR | All tests |
| Ecommerce β Unit Tests | Manual (Actions tab) | @Tag("ecomm-unit-tests") |
| Ecommerce β Sanity Tests | Manual (Actions tab) | @Tag("ecomm-sanity") |
| Run Tests by Tag | Manual with input | Any tag you specify |
π New to GitHub Actions? See docs/github-actions-guide.md for a full walkthrough.
| Technology | Version | Purpose |
|---|---|---|
| Java | 21 (LTS) | Language β enables records, switch expressions, var, .toList(), text blocks, and more |
| Maven | 3.6+ | Build tool |
| JUnit Jupiter | 5.10.2 | Unit testing framework |
| AssertJ | 3.19.0 | Fluent assertions |