@@ -0,0 +1,1644 @@
+package io.dropwizard.util;%0A%0Aimport com.google.common.base.CharMatcher;%0Aimport com.google.common.collect.ImmutableList;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.Parameterized;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0A@RunWith(Parameterized.class)%0Apublic class EnumsTest %7B%0A%0A    enum VideoFormat %7B%0A        OGG,%0A        MPEG_DASH,%0A        H_264,%0A        FFMPEG,%0A        HDMOV %7B%0A            @Override%0A            public String toString() %7B%0A                return %22QuickTime%22;%0A            %7D%0A        %7D;%0A%0A        // Factory methods are not handled%0A        public static VideoFormat fromString(String s) %7B%0A            return valueOf(CharMatcher.anyOf(%22%5B%5D%22).removeFrom(s));%0A        %7D%0A    %7D%0A%0A    @Parameterized.Parameters(name = %22Source:%7B0%7D, Guess:%7B1%7D%22)%0A    public static Iterable%3CObject%5B%5D%3E data() %7B%0A        return ImmutableList.copyOf(new Object%5B%5D%5B%5D%7B%0A            %7B%22OGG%22, VideoFormat.OGG%7D,%0A            %7B%22ogg%22, VideoFormat.OGG%7D,%0A            %7B%22FFmpeg%22, VideoFormat.FFMPEG%7D,%0A            %7B%22 FFmpeg %22, VideoFormat.FFMPEG%7D,%0A            %7B%22MPEG-DASH%22, VideoFormat.MPEG_DASH%7D,%0A            %7B%22h.264%22, VideoFormat.H_264%7D,%0A            %7B%22QuickTime%22, VideoFormat.HDMOV%7D,%0A            %7B%22%5BOGG%5D%22, null%7D,%0A            %7B%22FLV%22, null%7D,%0A        %7D);%0A    %7D%0A%0A    private final String sourceText;%0A    private final VideoFormat guessedFormat;%0A%0A    public EnumsTest(String text, VideoFormat result) %7B%0A        this.sourceText = text;%0A        this.guessedFormat = result;%0A    %7D%0A%0A    @Test%0A    public void canGuess() %7B%0A        assertThat(Enums.fromStringFuzzy(sourceText, VideoFormat.values())).isEqualTo(guessedFormat);%0A    %7D%0A%7D%0A

Add tests for fuzzy deserialized enums (#2200)