Skip to main content
added 295 characters in body; edited title
Source Link
Ivar
  • 7k
  • 12
  • 58
  • 69

Make assumption based on verify in Mockito assumptions

Can you make assumptionsassumptions with Mockito?

If the method's not invoked, this would throw AssertionError and make the test fail.

        then(mock).should().doSomething();

Instead, I want the test to be skipped, similar to assumeTrue()assumeTrue() (JUnit) or assumeThat()assumeThat() (AssertJ).

Mockito 4.11.0.

Mockito assumptions

Can you make assumptions with Mockito?

If the method's not invoked, this would throw AssertionError and make the test fail.

        then(mock).should().doSomething();

Instead, I want the test to be skipped, similar to assumeTrue() (JUnit) or assumeThat() (AssertJ).

Mockito 4.11.0.

Make assumption based on verify in Mockito

Can you make assumptions with Mockito?

If the method's not invoked, this would throw AssertionError and make the test fail.

then(mock).should().doSomething();

Instead, I want the test to be skipped, similar to assumeTrue() (JUnit) or assumeThat() (AssertJ).

Mockito 4.11.0.

Post Reopened by Sergey Zolotarev, Ivar, knittl
Post Closed as "Needs details or clarity" by Progman, gnat, khelwood
Source Link
Sergey Zolotarev
  • 2.7k
  • 1
  • 11
  • 39

Mockito assumptions

Can you make assumptions with Mockito?

If the method's not invoked, this would throw AssertionError and make the test fail.

        then(mock).should().doSomething();

Instead, I want the test to be skipped, similar to assumeTrue() (JUnit) or assumeThat() (AssertJ).

Mockito 4.11.0.