java - Check mocking call on array of objects -


I am trying to verify whether all the objects in an array are once called once.

I am using Powermokito and it is currently done again through objects

  (layer layer: layers) {Verify (layer, bar (1)). }  

Is there a more efficient way to check that all the objects in the array are called together once? That is, you can not check a condition for all the objects in any collection or array without recurrence.

. It may be possible to hide this information behind the Mockito method call, but still, Mockito will do a repetition to check the status for all your items.

If you use your test code more self -When you want to see a legendary view, you can make it a helpful method to reproduce

or if you were using Java 8:

You can use the stream .for (consumer) .

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -