unit testing - Easymock Unexpected method call error when EasyMock.expect() is specified -


i kept running following error:

org.apache.kafka.connect.runtime.distributed.distributedherdertest > testcreateconnector failed java.lang.assertionerror:   unexpected method call worker.getconnectortype("sourceb"):     worker.getplugins(): expected: 3, actual: 0     @ org.easymock.internal.mockinvocationhandler.invoke(mockinvocationhandler.java:44)     @ org.easymock.internal.objectmethodsfilter.invoke(objectmethodsfilter.java:94)     @ org.easymock.internal.classproxyfactory$mockmethodinterceptor.intercept(classproxyfactory.java:97)     @ org.apache.kafka.connect.runtime.worker$$enhancerbycglib$$124447d.getconnectortype(<generated>)     @ org.apache.kafka.connect.runtime.distributed.distributedherdertest.testcreateconnector(distributedherdertest.java:344) 

even though put in:

    easymock.expect(worker.getconnectortype(conn2)).andreturn(connectortype.source); 

code can found here: https://github.com/apache/kafka/pull/3812

advice welcome.

you need add worker.class @preparefortest({distributedherder.class, plugins.class}).


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -