Skip to content

Latest commit

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Java 8+ Practice Project

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.


📚 What Is This Project?

See docs/WHAT_IS_IT.md for a full overview of the project goals and structure.


📂 Project 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

🗂️ Learning Guides

GuideDescription
docs/WHAT_IS_IT.mdProject overview and learning goals
docs/optional-guide.mdDeep dive into Java Optional
docs/advanced-optional-scenarios-explained.mdAdvanced Optional patterns explained in depth
docs/functional-interface-function-guide.mdFunction<T,R>, andThen, compose
docs/junit5-tagging-guide.mdJUnit 5 @Tag, @DisplayName, selective test runs
docs/java21-modern-java-guide.mdJava 21 features used in this project
docs/github-actions-guide.mdGitHub Actions explained for beginners
docs/github-actions-advanced-guide.mdAdvanced GitHub Actions — concurrency, secrets, matrix, artifacts, reusable workflows

🚀 Running the Project

Prerequisites

  • Java 21+
  • Maven 3.6+

Run All Tests (locally)

mvn test

Run Tests by Tag (locally)

# 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"

Pass Custom System Properties

mvn test -DinParameter=MyValue

🤖 Run via GitHub Actions (CI/CD)

WorkflowTriggerWhat it runs
CI — Build & Test AllAuto on every push & PRAll tests
Ecommerce — Unit TestsManual (Actions tab)@Tag("ecomm-unit-tests")
Ecommerce — Sanity TestsManual (Actions tab)@Tag("ecomm-sanity")
Run Tests by TagManual with inputAny tag you specify

📖 New to GitHub Actions? See docs/github-actions-guide.md for a full walkthrough.


🛠️ Tech Stack

TechnologyVersionPurpose
Java21 (LTS)Language — enables records, switch expressions, var, .toList(), text blocks, and more
Maven3.6+Build tool
JUnit Jupiter5.10.2Unit testing framework
AssertJ3.19.0Fluent assertions

About

GitHub Actions demo

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages