我有一組單元測試,將存儲的XML文件解組到JAXB對象中。他們在工作。這些測試使用PowerMock(1.6.6),因爲CUT中的一個細節(測試代碼)需要「whenNew」子句。 我決定對一個對象工廠進行抽象,讓我轉向純Mockito。 當我這樣做時,在測試過程中,當將XML文件解組爲JAXB對象時,我開始出現無法解釋的問題。它根本不存儲某些元素到JAXB對象中。 ,做解組的方法是這樣的: pro
我嘲笑以下方法: public static void cleanAndCreateDirectories(@NonNull final Path path) throws IOException {
// If download directory exists(should not be symlinks, clear the contents.
System.out.
如何在爲靜態方法編寫junit時從靜態方法調用實例方法調用?我正在爲現有代碼編寫測試。 class A
{
public static D methodX()
{
B b = new B();
C c = b.doSomething();
}
}
class B
{
public C doSomething()
{