# @Test

Used to mark a function as a test in JUnit.

## What does `@Test` do?

In JUnit, `@Test` marks a method as a test.

```java
@Test
void deposit_should_increaseBalance() {
    var account = new Account();
    account.deposit(50);
    assertEquals(50, account.getBalance());
}
```

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

Updated: October 12, 2026

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