public class A {
public ResultSet executeCql(String cql, boolean cachePrepared, ConsistencyLevel consistencyLevel, Object... values)
{
//...
}
//...
}
I have mocked the class A. And I have tried to mock method its not working.
when(a.executeCql(anyString(), anyBoolean(), any(), any(Object[].class))).thenReturn(resultSet);
Help me on this.
I have tried this also.
when(cassandraHelper.executeCql(any(), anyBoolean(), any(ConsistencyLevel.class), Matchers.<Object>anyVararg())).thenReturn(resultSet);
Still this method returns null
instead of mocked ResultSet
.