当我试图运行junit测试文件时,它显示以下错误消息

时间:2013-04-29 08:07:09

标签: junit

当我尝试执行junit测试文件时,

Wanted but not invoked显示此消息

Wanted but not invoked:
dbUtilMockProxy.getArrayListHM(
    [01-01-2012, 1, edit, 2],
    "bc_pos_dist_list"
);
-> at test.bc_hierarchy.action.NodeMaintenanceActionTest.testDistributionList(NodeMaintenanceActionTest.java:409)

实际上,这个模拟没有互动。

    at test.bc_hierarchy.action.NodeMaintenanceActionTest.testDistributionList(NodeMaintenanceActionTest.java:409)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)



    assertThat(actualActionForward).isEqualTo(expectedActionForward);
        verify(requestMockProxy).getSession(false);
        verify(appParams).getSQLQuery(raSqlViewName, raSqlId);
        verify(componentsFactoryMock).getDBUtil();
        verify(componentsFactoryMock).getDBFetchBean();
        verify(sessionMockProxy).getAttribute(tradingDateSessionKey);
        verify(requestMockProxy).getParameter(nodeIdKey);
        verify(requestMockProxy).getParameter(saveFlagKey);
        verify(requestMockProxy).getParameter(levelIndicatorKey);
        verify(dbUtilMockProxy).getArrayListHM(givenArgs, expectedProcName);
        verify(dbFetchBeanMock).manipulateSQL(givenQuerry, givenArgs);
        verify(requestMockProxy).setAttribute("JSON_RESULT", givenJsonObject);
        verify(mappingMockProxy).findForward("bcJsonOutput");

1 个答案:

答案 0 :(得分:0)

你有

verify(dbUtilMockProxy).getArrayListHM(givenArgs, expectedProcName);

由于未使用所提供的参数调用或未调用getArrayListHN,因此未满足此断言。