add method

This commit is contained in:
Looly
2022-03-25 02:31:47 +08:00
parent da40e42124
commit 222f18e847
2 changed files with 21 additions and 3 deletions

View File

@@ -37,7 +37,7 @@ public class EnumUtilTest {
@Test
public void getByTest() {
// 枚举中字段互相映射使用
TestEnum testEnum = EnumUtil.getBy(TestEnum::getType, "type2");
TestEnum testEnum = EnumUtil.getBy(TestEnum::ordinal, 1);
Assert.assertEquals("TEST2", testEnum.name());
}