We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 917bf95 commit 1f6b17dCopy full SHA for 1f6b17d
src/test/java/rife/tools/TestConvert.java
@@ -172,6 +172,10 @@ public static MyCustomType fromString(String v) {
172
}
173
174
175
+ public enum Action {
176
+ none, add, modify, cancel
177
+ }
178
+
179
@Test
180
void testFromString()
181
throws ConversionException {
@@ -191,6 +195,9 @@ void testFromString()
191
195
assertThrows(ConversionException.class, () -> Convert.fromString("invalid", MyCustomType.class));
192
196
193
197
assertThrows(ConversionException.class, () -> Convert.fromString("custom", MyCustomType2.class));
198
199
+ assertEquals(Action.add, Convert.fromString("add", Action.class));
200
+ assertThrows(ConversionException.class, () -> Convert.fromString("nothing", Action.class));
194
201
202
203
0 commit comments