# Test Fixture

The known objects and data prepared for a test.

## What is **Test Fixture** in Java?

**Test Fixture** — The known objects and data prepared for a test.

```java
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;

class OrderCalculatorTest {
    @Test
    void totalsAnOrder() {
        int total = 3 * 4;
        assertEquals(12, total);
    }
}
```

Level: Freelancer · [More Java terms at this level](https://www.ask-codey.com/glossary/subjects/java/freelancer)

Updated: September 27, 2026

## In other subjects

- [Test Fixture in C#](https://www.ask-codey.com/glossary/test-fixture-c-sharp)

Source: https://www.ask-codey.com/glossary/test-fixture-java
