@Test void parseShouldReturnCorrectValue() { String version = "rfc-8621"; assertThat(versionParser.parse(version)).isEqualTo(Version.RFC8621); }
@VisibleForTesting Version parse(String version) { Preconditions.checkNotNull(version); return supportedVersions.stream() .filter(jmapVersion -> jmapVersion.asString().equalsIgnoreCase(version)) .findFirst() .orElseThrow(() -> new IllegalArgumentException(version + " is not a supported version")); }
VersionParser { @VisibleForTesting Version parse(String version) { Preconditions.checkNotNull(version); return supportedVersions.stream() .filter(jmapVersion -> jmapVersion.asString().equalsIgnoreCase(version)) .findFirst() .orElseThrow(() -> new IllegalArgumentException(version + " is not a supported version")); } }
VersionParser { @VisibleForTesting Version parse(String version) { Preconditions.checkNotNull(version); return supportedVersions.stream() .filter(jmapVersion -> jmapVersion.asString().equalsIgnoreCase(version)) .findFirst() .orElseThrow(() -> new IllegalArgumentException(version + " is not a supported version")); } @Inject  VersionParser(Set<Version> supportedVersions); }
VersionParser { @VisibleForTesting Version parse(String version) { Preconditions.checkNotNull(version); return supportedVersions.stream() .filter(jmapVersion -> jmapVersion.asString().equalsIgnoreCase(version)) .findFirst() .orElseThrow(() -> new IllegalArgumentException(version + " is not a supported version")); } @Inject  VersionParser(Set<Version> supportedVersions);  }
VersionParser { @VisibleForTesting Version parse(String version) { Preconditions.checkNotNull(version); return supportedVersions.stream() .filter(jmapVersion -> jmapVersion.asString().equalsIgnoreCase(version)) .findFirst() .orElseThrow(() -> new IllegalArgumentException(version + " is not a supported version")); } @Inject  VersionParser(Set<Version> supportedVersions);   }