Files
lnd-manageJ/web/src/test/java/de/cotto/lndmanagej/controller/NotFoundExceptionHandlerTest.java
2021-11-22 20:24:13 +01:00

23 lines
716 B
Java

package de.cotto.lndmanagej.controller;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.http.HttpStatus;
import static org.assertj.core.api.Assertions.assertThat;
@ExtendWith(MockitoExtension.class)
class NotFoundExceptionHandlerTest {
private static final NotFoundException EXCEPTION = new NotFoundException();
@InjectMocks
private NotFoundExceptionHandler exceptionHandler;
@Test
void mapsToNotFound() {
assertThat(exceptionHandler.handleException(EXCEPTION).getStatusCode())
.isEqualTo(HttpStatus.NOT_FOUND);
}
}