Bug: cleanup policy compact delete could be without space (#829)

This commit is contained in:
German Osin 2021-08-27 12:44:45 +03:00 committed by GitHub
parent 5302c3e47f
commit 859e9fb88d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,7 @@ import java.util.Arrays;
public enum CleanupPolicy {
DELETE("delete"),
COMPACT("compact"),
COMPACT_DELETE("compact, delete"),
COMPACT_DELETE("compact,delete"),
UNKNOWN("unknown");
private final String cleanUpPolicy;
@ -21,7 +21,7 @@ public enum CleanupPolicy {
public static CleanupPolicy fromString(String string) {
return Arrays.stream(CleanupPolicy.values())
.filter(v -> v.cleanUpPolicy.equals(string))
.filter(v -> v.cleanUpPolicy.equals(string.replace(" ", "")))
.findFirst()
.orElseThrow(() ->
new IllegalEntityStateException("Unknown cleanup policy value: " + string));