mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-21 06:54:29 +01:00
restructure project
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user