0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

junit private eunm 変数設定方法

Posted at

------------junit private eunm 変数設定方法

Class<?>enumClass = Class.forName("対象変数");

method = targetClass.class.getDeclaredMethod(enumClass );

method.setAccessible(true);

Object enumVale = Enum.valueOf(Class<Enum>) enumClass);

result = (boolean)method.invoke(target,enumVale);
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?