fix modifier bug

This commit is contained in:
Looly
2021-03-18 21:48:14 +08:00
parent abdedf6822
commit 8e8518c8d1
4 changed files with 51 additions and 18 deletions

View File

@@ -0,0 +1,21 @@
package cn.hutool.core.util;
import org.junit.Assert;
import org.junit.Test;
import java.lang.reflect.Method;
public class ModifierUtilTest {
@Test
public void hasModifierTest() throws NoSuchMethodException {
Method method = ModifierUtilTest.class.getDeclaredMethod("ddd");
Assert.assertTrue(ModifierUtil.hasModifier(method, ModifierUtil.ModifierType.PRIVATE));
Assert.assertTrue(ModifierUtil.hasModifier(method,
ModifierUtil.ModifierType.PRIVATE,
ModifierUtil.ModifierType.STATIC)
);
}
private static void ddd() {
}
}