com.eclipsesource.restfuse
Interface PollState

All Known Implementing Classes:
PollStateImpl

public interface PollState

A PollState acts as a consistent state during a poll series. The PollState object will be injected into a test object when it has a field of the type PollState which is annotated with the Context annotation. After the injection it can be used to test the responses of the poll series.

See Also:
Poll, Context

Method Summary
 void abort()
          Aborts a poll series.
 Response getResponse(int attempt)
          Returns a single response for a specific request attempt with a poll series.
 java.util.List<Response> getResponses()
          Returns all responses that were received during the poll series.
 int getTimes()
          Returns the number of the last request attempt.
 

Method Detail

abort

void abort()

Aborts a poll series. After this method was called JUnit will continue with the next test method.


getResponse

Response getResponse(int attempt)
                     throws java.lang.IllegalArgumentException

Returns a single response for a specific request attempt with a poll series.

Throws:
java.lang.IllegalArgumentException

getResponses

java.util.List<Response> getResponses()

Returns all responses that were received during the poll series.


getTimes

int getTimes()

Returns the number of the last request attempt. It can be used to get the current response when it will be passed to the getResponse(int) method.