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

adjust not foun exception message

parent 58b72680
Branches
Tags
No related merge requests found
...@@ -7,6 +7,6 @@ public class NotFoundException extends RuntimeException { ...@@ -7,6 +7,6 @@ public class NotFoundException extends RuntimeException {
private static final String MESSAGE_TEMPL = "%s with id '%s' not found."; private static final String MESSAGE_TEMPL = "%s with id '%s' not found.";
public NotFoundException(StringBasedValue id, String entityName) { public NotFoundException(StringBasedValue id, String entityName) {
super(MESSAGE_TEMPL.formatted(id.toString(), entityName)); super(MESSAGE_TEMPL.formatted(entityName, id.toString()));
} }
} }
package de.ozgcloud.apilib.common.errorhandling;
import static org.assertj.core.api.Assertions.*;
import org.junit.jupiter.api.Test;
import de.ozgcloud.apilib.common.datatypes.GenericId;
class NotFoundExceptionTest {
private final GenericId id = GenericId.from("dummyId");
private final String entityName = "DummyEntity";
@Test
void shouldHaveMessage() {
var exception = new NotFoundException(id, entityName);
assertThat(exception.getMessage()).isEqualTo(entityName + " with id '" + id + "' not found.");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment