restructure project

This commit is contained in:
Carsten Otto
2021-11-22 20:24:13 +01:00
parent a82cb13ef7
commit 874e8fffa6
55 changed files with 46 additions and 14 deletions

View File

@@ -0,0 +1,29 @@
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 CostExceptionHandlerTest {
private static final CostException EXCEPTION = new CostException("abc");
@InjectMocks
private CostExceptionHandler costExceptionHandler;
@Test
void mapsToBadRequest() {
assertThat(costExceptionHandler.handleException(EXCEPTION).getStatusCode())
.isEqualTo(HttpStatus.BAD_REQUEST);
}
@Test
void returnsMessageInBody() {
assertThat(costExceptionHandler.handleException(EXCEPTION).getBody())
.isEqualTo(EXCEPTION.getMessage());
}
}