Подключил Spring Boot и добавил API получения операций с обработкой 404 и HTTP-тестом

This commit is contained in:
Kashey committed 2026-10-20 19:41:53 +03:00
1 parent 70f61cdc64
commit cd404fae0b
11 files changed
+194 -12

No files matched your search

+5 -3
View File
@@ -44,6 +44,10 @@ public class OperationService {
return ledger.isPosted(operation.getId());
}
public Operation getById(Long operationId) {
return requiredOperation(operationId);
}
private Operation requiredOperation(Long operationId) {
if (operationId == null) {
@@ -53,9 +57,7 @@ public class OperationService {
Operation operation = journal.getOperationById(operationId);
if (operation == null) {
throw new IllegalArgumentException(
"Операция не найдена: " + operationId
);
throw new OperationNotFoundException(operationId);
}
return operation;
}