Package net.jadler.mocking
Class Verifying
- java.lang.Object
-
- net.jadler.AbstractRequestMatching<Verifying>
-
- net.jadler.mocking.Verifying
-
- All Implemented Interfaces:
RequestMatching<Verifying>
public class Verifying extends AbstractRequestMatching<Verifying>
Allows defining new verification in a fluid fashion. You shouldn't create instances of this class on your own, please seeJadler.verifyThatRequest()for more information on creating instances of this class.
-
-
Field Summary
-
Fields inherited from class net.jadler.AbstractRequestMatching
predicates
-
-
Constructor Summary
Constructors Constructor Description Verifying(RequestManager requestManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidreceivedNever()Checks that no request described in this verifying object has been received so far.voidreceivedOnce()Checks that exactly one request described in this verifying object has been received so far.voidreceivedTimes(int count)Checks whether the number of requests described in this verifying object received so far matches the exact value.voidreceivedTimes(org.hamcrest.Matcher<Integer> nrRequestsPredicate)Checks whether the number of requests described in this verifying object received so far matches the given predicate.-
Methods inherited from class net.jadler.AbstractRequestMatching
havingBody, havingBodyEqualTo, havingHeader, havingHeader, havingHeaderEqualTo, havingHeaders, havingMethod, havingMethodEqualTo, havingParameter, havingParameter, havingParameterEqualTo, havingParameters, havingPath, havingPathEqualTo, havingQueryString, havingQueryStringEqualTo, havingRawBodyEqualTo, that
-
-
-
-
Constructor Detail
-
Verifying
public Verifying(RequestManager requestManager)
- Parameters:
requestManager- request manager instance to assist the verification
-
-
Method Detail
-
receivedTimes
public void receivedTimes(org.hamcrest.Matcher<Integer> nrRequestsPredicate)
Checks whether the number of requests described in this verifying object received so far matches the given predicate.- Parameters:
nrRequestsPredicate- to be applied on the number of requests- Throws:
VerificationException- if the number of requests described by this verifying is not matched by the given predicate
-
receivedTimes
public void receivedTimes(int count)
Checks whether the number of requests described in this verifying object received so far matches the exact value.- Parameters:
count- expected number of requests described by this verifying object- Throws:
VerificationException- if the number of requests described in this verifying object received so far is not equal to the expected value
-
receivedOnce
public void receivedOnce()
Checks that exactly one request described in this verifying object has been received so far.- Throws:
VerificationException- if the number of expected requests is not equal to one
-
receivedNever
public void receivedNever()
Checks that no request described in this verifying object has been received so far.- Throws:
VerificationException- if at least one request described in this object has already been received
-
-