Skip to content

Commit

Permalink
Fix spelling of class PropertyKey
Browse files Browse the repository at this point in the history
  • Loading branch information
MaisiKoleni committed Mar 19, 2021
1 parent cc94ac7 commit 9c8fcaa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -104,8 +104,8 @@ public Throwable create(ThrowableInfo throwableInfo) {

private static class HttpRetryExceptionCreator implements ThrowableCreator {

private static final ProperyKey<Integer> RESPONSE_CODE = new ProperyKey<>(int.class, "responseCode");
private static final ProperyKey<String> LOCATION = new ProperyKey<>(String.class, "location");
private static final PropertyKey<Integer> RESPONSE_CODE = new PropertyKey<>(int.class, "responseCode");
private static final PropertyKey<String> LOCATION = new PropertyKey<>(String.class, "location");

@Override
public Throwable create(ThrowableInfo info) {
Expand All @@ -118,8 +118,8 @@ public Throwable create(ThrowableInfo info) {

private static class DateTimeParseExceptionCreator implements ThrowableCreator {

private static final ProperyKey<String> PARSED_STRING = new ProperyKey<>(String.class, "parsedString");
private static final ProperyKey<Integer> ERROR_INDEX = new ProperyKey<>(int.class, "errorIndex");
private static final PropertyKey<String> PARSED_STRING = new PropertyKey<>(String.class, "parsedString");
private static final PropertyKey<Integer> ERROR_INDEX = new PropertyKey<>(int.class, "errorIndex");

@Override
public Throwable create(ThrowableInfo info) {
Expand All @@ -139,8 +139,8 @@ public Throwable create(ThrowableInfo info) {

private static class MissingResourceExceptionCreator implements ThrowableCreator {

private static final ProperyKey<String> CLASS_NAME = new ProperyKey<>(String.class, "className");
private static final ProperyKey<String> KEY = new ProperyKey<>(String.class, "key");
private static final PropertyKey<String> CLASS_NAME = new PropertyKey<>(String.class, "className");
private static final PropertyKey<String> KEY = new PropertyKey<>(String.class, "key");

@Override
public Throwable create(ThrowableInfo info) {
Expand All @@ -155,8 +155,8 @@ private static class ComparisonFailureCreator implements ThrowableCreator {

private static final int MAX_CONTEXT_LENGTH = 20;

private static final ProperyKey<String> EXPECTED = new ProperyKey<>(String.class, "expected");
private static final ProperyKey<String> ACTUAL = new ProperyKey<>(String.class, "actual");
private static final PropertyKey<String> EXPECTED = new PropertyKey<>(String.class, "expected");
private static final PropertyKey<String> ACTUAL = new PropertyKey<>(String.class, "actual");

@Override
public Throwable create(ThrowableInfo info) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ public Map<String, Object> toPropertyMap() {
return properties;
}

public <T> T getProperty(ProperyKey<T> key) {
public <T> T getProperty(PropertyKey<T> key) {
return key.cast(additionalProperties.get(key.name()));
}

public <T> void setProperty(ProperyKey<T> key, T newValue) {
public <T> void setProperty(PropertyKey<T> key, T newValue) {
additionalProperties.put(key.name(), key.cast(newValue));
}

Expand Down Expand Up @@ -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<T> {
public static class PropertyKey<T> {

private final Class<T> type;
private final String name;
private final UnaryOperator<T> sanitizer;

public ProperyKey(Class<T> type, String name, UnaryOperator<T> sanitizer) {
public PropertyKey(Class<T> type, String name, UnaryOperator<T> sanitizer) {
this.type = Objects.requireNonNull(type);
this.name = Objects.requireNonNull(name);
this.sanitizer = Objects.requireNonNull(sanitizer);
}

public ProperyKey(Class<T> type, String name) {
public PropertyKey(Class<T> type, String name) {
this(type, name, UnaryOperator.identity());
}

Expand Down

0 comments on commit 9c8fcaa

Please sign in to comment.