Class ExpectedCount

java.lang.Object
org.springframework.test.web.client.ExpectedCount

public final class ExpectedCount extends Object
A simple type representing a range for an expected count.

Examples:

 import static org.springframework.test.web.client.ExpectedCount.*

 once()
 twice()
 manyTimes()
 times(5)
 min(2)
 max(4)
 between(2, 4)
 never()
 
Since:
4.3
Author:
Rossen Stoyanchev
  • Method Details

    • getMinCount

      public int getMinCount()
      Return the min boundary of the expected count range.
    • getMaxCount

      public int getMaxCount()
      Return the max boundary of the expected count range.
    • once

      public static ExpectedCount once()
      Exactly once.
    • twice

      public static ExpectedCount twice()
      Exactly twice.
    • manyTimes

      public static ExpectedCount manyTimes()
      Many times (range of 1..Integer.MAX_VALUE).
    • times

      public static ExpectedCount times(int count)
      Exactly N times.
    • min

      public static ExpectedCount min(int min)
      At least min number of times.
    • max

      public static ExpectedCount max(int max)
      At most max number of times.
    • never

      public static ExpectedCount never()
      No calls expected at all, i.e. min=0 and max=0.
      Since:
      4.3.6
    • between

      public static ExpectedCount between(int min, int max)
      Between min and max number of times.