Skip to content
Snippets Groups Projects
Commit be828e58 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-4529 [xta] replace IllegalArgumentException with TechnicalException

parent 9b8a462d
Branches
Tags
No related merge requests found
......@@ -5,6 +5,7 @@ import java.time.LocalDate;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.stereotype.Component;
import de.ozgcloud.common.errorhandling.TechnicalException;
import lombok.RequiredArgsConstructor;
@Component
......@@ -22,7 +23,7 @@ public class VorgangNummerSupplier {
public String get(int suffixLength) {
if (suffixLength <1){
throw new IllegalArgumentException("Suffix length must be at least 1");
throw new TechnicalException("Suffix length must be at least 1");
}
var today = LocalDate.now();
var lastYearNumber = today.getYear() % 10;
......
......@@ -14,6 +14,8 @@ import org.junit.jupiter.params.provider.ValueSource;
import org.mockito.InjectMocks;
import org.mockito.Spy;
import de.ozgcloud.common.errorhandling.TechnicalException;
class VorgangNummerSupplierTest {
@Spy
......@@ -40,7 +42,7 @@ class VorgangNummerSupplierTest {
@ParameterizedTest(name = "suffix length {0}")
@ValueSource(ints = { -1, 0 })
void shouldThrowException(int suffixLength) {
assertThrows(IllegalArgumentException.class, () -> vorgangNummerSupplier.get(suffixLength));
assertThrows(TechnicalException.class, () -> vorgangNummerSupplier.get(suffixLength));
}
private String getSuffix(String string) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment