差異處
這裏顯示兩個版本的差異處。
Both sides previous revision 前次修改 下次修改 | 前次修改 | ||
java:junit:powermock:mockclassfield [2017/08/19 23:33] 127.0.0.1 外部編輯 |
java:junit:powermock:mockclassfield [2023/06/25 09:48] (目前版本) |
||
---|---|---|---|
行 49: | 行 49: | ||
System.out.println(Constants.PI); | System.out.println(Constants.PI); | ||
</code> | </code> | ||
+ | Note. PI需從double改為Double物件。 | ||
===== Reference ===== | ===== Reference ===== | ||
* [[http://en.wikipedia.org/wiki/Constant_interface|Constant Interface]] | * [[http://en.wikipedia.org/wiki/Constant_interface|Constant Interface]] | ||
* [[http://stackoverflow.com/questions/9697531/how-to-mock-a-static-final-variable-using-junit-easymock-or-powermock|Mock a Static-Final-Variable]] | * [[http://stackoverflow.com/questions/9697531/how-to-mock-a-static-final-variable-using-junit-easymock-or-powermock|Mock a Static-Final-Variable]] | ||
+ | * [[https://stackoverflow.com/questions/33281347/how-do-i-set-a-primitive-private-static-final-field-in-a-class-with-private-cons?lq=1|How do I set a primitive private static final field in a class with private constructor using PowerMockito?]] | ||
===== ===== | ===== ===== | ||
---- | ---- | ||
\\ | \\ | ||
~~DISQUS~~ | ~~DISQUS~~ |