diff --git a/src/main/java/de/tum/in/test/api/internal/sanitization/SafeTypeThrowableSanitizer.java b/src/main/java/de/tum/in/test/api/internal/sanitization/SafeTypeThrowableSanitizer.java index 1fa04b45..462d9ee4 100644 --- a/src/main/java/de/tum/in/test/api/internal/sanitization/SafeTypeThrowableSanitizer.java +++ b/src/main/java/de/tum/in/test/api/internal/sanitization/SafeTypeThrowableSanitizer.java @@ -18,7 +18,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import de.tum.in.test.api.internal.sanitization.ThrowableInfo.ProperyKey; +import de.tum.in.test.api.internal.sanitization.ThrowableInfo.PropertyKey; import de.tum.in.test.api.util.LruCache; enum SafeTypeThrowableSanitizer implements SpecificThrowableSanitizer { @@ -104,8 +104,8 @@ public Throwable create(ThrowableInfo throwableInfo) { private static class HttpRetryExceptionCreator implements ThrowableCreator { - private static final ProperyKey RESPONSE_CODE = new ProperyKey<>(int.class, "responseCode"); - private static final ProperyKey LOCATION = new ProperyKey<>(String.class, "location"); + private static final PropertyKey RESPONSE_CODE = new PropertyKey<>(int.class, "responseCode"); + private static final PropertyKey LOCATION = new PropertyKey<>(String.class, "location"); @Override public Throwable create(ThrowableInfo info) { @@ -118,8 +118,8 @@ public Throwable create(ThrowableInfo info) { private static class DateTimeParseExceptionCreator implements ThrowableCreator { - private static final ProperyKey PARSED_STRING = new ProperyKey<>(String.class, "parsedString"); - private static final ProperyKey ERROR_INDEX = new ProperyKey<>(int.class, "errorIndex"); + private static final PropertyKey PARSED_STRING = new PropertyKey<>(String.class, "parsedString"); + private static final PropertyKey ERROR_INDEX = new PropertyKey<>(int.class, "errorIndex"); @Override public Throwable create(ThrowableInfo info) { @@ -139,8 +139,8 @@ public Throwable create(ThrowableInfo info) { private static class MissingResourceExceptionCreator implements ThrowableCreator { - private static final ProperyKey CLASS_NAME = new ProperyKey<>(String.class, "className"); - private static final ProperyKey KEY = new ProperyKey<>(String.class, "key"); + private static final PropertyKey CLASS_NAME = new PropertyKey<>(String.class, "className"); + private static final PropertyKey KEY = new PropertyKey<>(String.class, "key"); @Override public Throwable create(ThrowableInfo info) { @@ -155,8 +155,8 @@ private static class ComparisonFailureCreator implements ThrowableCreator { private static final int MAX_CONTEXT_LENGTH = 20; - private static final ProperyKey EXPECTED = new ProperyKey<>(String.class, "expected"); - private static final ProperyKey ACTUAL = new ProperyKey<>(String.class, "actual"); + private static final PropertyKey EXPECTED = new PropertyKey<>(String.class, "expected"); + private static final PropertyKey ACTUAL = new PropertyKey<>(String.class, "actual"); @Override public Throwable create(ThrowableInfo info) { diff --git a/src/main/java/de/tum/in/test/api/internal/sanitization/ThrowableInfo.java b/src/main/java/de/tum/in/test/api/internal/sanitization/ThrowableInfo.java index 0921ec26..2838c836 100644 --- a/src/main/java/de/tum/in/test/api/internal/sanitization/ThrowableInfo.java +++ b/src/main/java/de/tum/in/test/api/internal/sanitization/ThrowableInfo.java @@ -150,11 +150,11 @@ public Map toPropertyMap() { return properties; } - public T getProperty(ProperyKey key) { + public T getProperty(PropertyKey key) { return key.cast(additionalProperties.get(key.name())); } - public void setProperty(ProperyKey key, T newValue) { + public void setProperty(PropertyKey key, T newValue) { additionalProperties.put(key.name(), key.cast(newValue)); } @@ -183,19 +183,19 @@ public static ThrowableInfo getEssentialInfosSafeFrom(Throwable source) { return ThrowableInfo.of(source.getClass(), message, cause, stackTrace, suppressed, Map.of()); } - public static class ProperyKey { + public static class PropertyKey { private final Class type; private final String name; private final UnaryOperator sanitizer; - public ProperyKey(Class type, String name, UnaryOperator sanitizer) { + public PropertyKey(Class type, String name, UnaryOperator sanitizer) { this.type = Objects.requireNonNull(type); this.name = Objects.requireNonNull(name); this.sanitizer = Objects.requireNonNull(sanitizer); } - public ProperyKey(Class type, String name) { + public PropertyKey(Class type, String name) { this(type, name, UnaryOperator.identity()); }