title: net.serenitybdd.core.exceptions.SerenityManagedException: SERENITY_DISABLE_REST_CALLS_AFTER_FAILURES
body: <p>I am following many examples of serenity bdd testing API. Mainly (<a href="https://github.com/serenity-bdd/serenity-core/blob/master/serenity-screenplay-rest/src/test/java/net/serenitybdd/screenplay/rest/examples/WhenRetrievingUserDetails.java" rel="nofollow noreferrer">https://github.com/serenity-bdd/serenity-core/blob/master/serenity-screenplay-rest/src/test/java/net/serenitybdd/screenplay/rest/examples/WhenRetrievingUserDetails.java</a>)</p>
  
  <p>But when I run my code I am always getting:</p>
  
  <pre><code>TEST FAILED WITH ERROR: User attempts to recover the password
  ---------------------------------------------------------------------
  [main] ERROR net.serenitybdd.core.Serenity - TEST FAILED AT STEP Rest
  [main] ERROR net.serenitybdd.core.Serenity - SERENITY_DISABLE_REST_CALLS_AFTER_FAILURES
  
  net.serenitybdd.core.exceptions.SerenityManagedException: SERENITY_DISABLE_REST_CALLS_AFTER_FAILURES
  
      at net.serenitybdd.rest.utils.RestExecutionHelper.restCallsAreDisabled(RestExecutionHelper.java:28)
      at net.serenitybdd.rest.utils.RestSpecificationFactory.getInstrumentedRequestSpecification(RestSpecificationFactory.java:105)
      at net.serenitybdd.rest.utils.RestDecorationHelper.decorate(RestDecorationHelper.java:20)
      at net.serenitybdd.rest.SerenityRest.given(SerenityRest.java:220)
      at net.serenitybdd.screenplay.rest.interactions.RestInteraction.rest(RestInteraction.java:32)
      at net.serenitybdd.screenplay.rest.interactions.Post$$EnhancerByCGLIB$$6437c6d9.CGLIB$rest$3(&lt;generated&gt;)
      at net.serenitybdd.screenplay.rest.interactions.Post$$EnhancerByCGLIB$$6437c6d9$$FastClassByCGLIB$$49fc3d71.invoke(&lt;generated&gt;)
      at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
      at net.thucydides.core.steps.BaseMethodRunner.invokeMethod(BaseMethodRunner.java:10)
      at net.thucydides.core.steps.NormalMethodRunner.invokeMethodAndNotifyFailures(NormalMethodRunner.java:20)
      at net.thucydides.core.steps.StepInterceptor.runNormalMethod(StepInterceptor.java:361)
      at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:132)
      at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:68)
      at net.serenitybdd.screenplay.rest.interactions.Post$$EnhancerByCGLIB$$6437c6d9.rest(&lt;generated&gt;)
      at net.serenitybdd.screenplay.rest.interactions.Post.performAs(Post.java:24)
      at net.serenitybdd.screenplay.rest.interactions.Post$$EnhancerByCGLIB$$6437c6d9.CGLIB$performAs$0(&lt;generated&gt;)
      at net.serenitybdd.screenplay.rest.interactions.Post$$EnhancerByCGLIB$$6437c6d9$$FastClassByCGLIB$$49fc3d71.invoke(&lt;generated&gt;)
      at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
      at net.thucydides.core.steps.StepInterceptor.invokeMethod(StepInterceptor.java:449)
      at net.thucydides.core.steps.StepInterceptor.executeTestStepMethod(StepInterceptor.java:434)
      at net.thucydides.core.steps.StepInterceptor.runTestStep(StepInterceptor.java:409)
      at net.thucydides.core.steps.StepInterceptor.runOrSkipMethod(StepInterceptor.java:150)
      at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:137)
      at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:68)
      at net.serenitybdd.screenplay.rest.interactions.Post$$EnhancerByCGLIB$$6437c6d9.performAs(&lt;generated&gt;)
      at net.serenitybdd.screenplay.Actor.perform(Actor.java:100)
      at net.serenitybdd.screenplay.Actor.attemptsTo(Actor.java:84)
      at jarv.serenity.carnival.features.steps.steps.RecoverUserNameSteps.he_attemps_to_recover_password(RecoverUserNameSteps.java:40)
      at ✽.he sends the required information to recover his password(src/test/resources/features/ProfileManagement.feature:7)
  </code></pre>
  
  <p>I have the following test steps:</p>
  
  <pre><code>package jarv.serenity.carnival.features.steps.steps;
  import net.serenitybdd.screenplay.rest.abilities.CallAnApi;
  import net.serenitybdd.screenplay.rest.interactions.Post;
  import cucumber.api.java.Before;
  import cucumber.api.java.en.Given;
  import cucumber.api.java.en.Then;
  import cucumber.api.java.en.When;
  import net.serenitybdd.screenplay.Actor;
  import static org.hamcrest.Matchers.equalTo;
  import static net.serenitybdd.screenplay.rest.questions.ResponseConsequence.seeThatResponse;
  
  public class RecoverUserNameSteps {
  
      private String theRestApiBaseUrl = "https://www.carnival.com/ProfileManagement/api/v1.0";
      private Actor jorge;
      private String userName;
  
      @Before
      public void set_the_test(){
          jorge = Actor.named("Jorge, learning serenity rest").whoCan(CallAnApi.at(theRestApiBaseUrl));
      }
  
      @Given("^Jorge is not a registered user$")
      public void jorge_is_not_registered() throws Throwable {
          //TODO: Investigate what should be done here???
      }
  
      @Given("^he wants to recover his password$")
      public void jorge_wants_to_recover_the_password() throws Throwable {
          //I am setting this as blank cause the service to retrieve the password will only failed if request parameter is blank!!!
          //When sending any other kind of string response is 202 Accepted, only blanks generate 400 Bad request
          //Test may need to be changed to recover username instead, which has more options to get the error code
          userName = "";
      }
  
      @When("^he sends the required information to recover his password$")
      public void he_attemps_to_recover_password() throws Throwable {
          //TODO: Create Object Model for Request Body and send it. Anyway example is way too simple to do that and I am running out of time Julian.
          jorge.attemptsTo(
                  Post.to("/Accounts/Password/Forgot")
                          .with(request -&gt; request.header("Content-Type", "application/json")
                                  .body("{\"username\": \"joe\"}")
                          )
          );
      }
  
      @Then("^he should be informed that operation could not be done$")
      public void he_must_see_a_failed_response() throws Throwable {
          jorge.should(
                  seeThatResponse( "Recover for password was denied",
                          response -&gt; response.statusCode(400)
                  )
          );
      }
  }
  </code></pre>
  
  <p>This is my maven with rest related dependencies</p>
  
  <pre><code>&lt;dependency&gt;
              &lt;groupId&gt;net.serenity-bdd&lt;/groupId&gt;
              &lt;artifactId&gt;serenity-rest-assured&lt;/artifactId&gt;
              &lt;version&gt;2.0.34&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;net.serenity-bdd&lt;/groupId&gt;
              &lt;artifactId&gt;serenity-screenplay-rest&lt;/artifactId&gt;
              &lt;version&gt;2.0.34&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>This is my fork git hub repo: <a href="https://github.com/jarvcol/CarnivalTest/tree/addApiTesting" rel="nofollow noreferrer">https://github.com/jarvcol/CarnivalTest/tree/addApiTesting</a></p>
  
  <p>Any idea on this???</p>