# Getting Started

Welcome to the project. If you just joined the team and are wondering where to start reading, this guide will get you oriented in under five minutes.

---

## What This Project Does

This is a small Java project centered around order processing — specifically, an `OrderService` class along with a suite of tests written in both JUnit and TestNG. It includes a mix of legacy and annotated test classes, standalone test runners, and utility-only test utilities, making it a good entry point for understanding testing patterns in a Java codebase.

---

## Recommended Reading Order

Follow this order to build a mental model of the codebase efficiently:

1. **[Overview](../overview.md)** — A high-level summary of the project, technology stack, and architecture. Read this first for the big picture.
2. **`OrderService.java`** — The single production class in the codebase. Understanding what it does is the fastest way to understand *why* the tests exist.
3. **`OrderServiceTest.java`** — The primary JUnit test. Shows the most common testing pattern in the repo.
4. **[Architecture Wiki](../architecture.md)** — If available, for deeper module-level structure.

---

## Key Entry Points

Start with these classes in order:

| Class | File | Why it matters |
|---|---|---|
| `OrderService` | `src/main/java/com/example/OrderService.java` | The central class under test — the only production logic. |
| `OrderServiceTest` | `src/test/java/com/example/OrderServiceTest.java` | The primary JUnit test, showing how the service is exercised. |
| `TestNGTest` | `src/main/java/com/example/TestNGTest.java` | Example of TestNG-based testing in the project. |
| `TestHelper` | `src/main/java/com/example/TestHelper.java` | Shared test utility used across test classes. |

---

## Project Structure

The codebase is organized into four distinct source directories:

```mermaid
flowchart TD
    Main["Main Sources
src/main/java/com/example/"]
    Tests["Test Sources
src/test/java/com/example/"]
    Utils["Utils
src/utils/"]
    Standalone["Standalone
standalone/"]
    Core["OrderService
Core production logic"]
    Legacy["LegacyTest
Legacy test class"]
    Rogue["RogueTestAnnotated
Annotated test outside tests/"]
    Helper["TestHelper
Shared test utilities"]
    TNG["TestNGTest
TestNG-based test"]
    ST["OrderServiceTest
JUnit-based test"]
    Unannot["UnannotatedInTest
No @Test annotation"]
    ImportOnly["ImportOnlyTest
Import-only utility"]
    StandaloneT["OrderServiceTest
Standalone runner"]

    Main --> Core
    Main --> Legacy
    Main --> Rogue
    Main --> Helper
    Main --> TNG
    Tests --> ST
    Tests --> Unannot
    Utils --> ImportOnly
    Standalone --> StandaloneT
```

| Directory | Purpose |
|---|---|
| `src/main/java/com/example/` | Production code and helper classes |
| `src/test/java/com/example/` | Standard JUnit and TestNG tests |
| `src/utils/` | Test utility classes with no test methods |
| `standalone/` | Self-contained test runner |

---

## Configuration

This is a minimal Java project. The following files (if present in your checkout) are worth knowing about:

- **`pom.xml` or `build.gradle`** — The build configuration. This project uses either Maven or Gradle; check which file exists to determine how to compile and run tests.
- **No application frameworks** (Spring, Hibernate, etc.) were detected. The project depends only on JUnit and TestNG.

---

## Common Patterns

- **Testing frameworks:** The project uses both JUnit (via `@Test` from `org.junit.Test`) and TestNG (via `@Test` from `org.testng.annotations.Test`). Be mindful of which import a class uses — the two are not interchangeable.
- **Test placement convention:** Most tests live in `src/test/java`, but `LegacyTest`, `RogueTestAnnotated`, and `TestNGTest` are placed in `src/main/java`. These are kept in main sources for legacy or experimental reasons and should not be used as templates for new tests.
- **Utility classes:** `TestHelper` and `ImportOnlyTest` are utility-only — they contain no test methods themselves and are imported by other classes.
- **Standalone tests:** The `standalone/` directory contains a self-contained copy of `OrderServiceTest` intended to be run independently of the standard test infrastructure.
