package me.atam.atam4jsampleapp;

import me.atam.atam4j.PollingPredicate;
import me.atam.atam4j.dummytests.PassingTest;
import me.atam.atam4j.health.AcceptanceTestsHealthCheck;
import me.atam.atam4jsampleapp.testsupport.AcceptanceTest;
import me.atam.atam4jsampleapp.testsupport.Atam4jApplicationStarter;
import me.atam.atam4jsampleapp.testsupport.HealthCheckResult;
import org.junit.Test;

import javax.ws.rs.core.Response;

public class PassingTestAcceptanceTest extends AcceptanceTest {

    public static final int MAX_ATTEMPTS = 2000;
    public static final int RETRY_POLL_INTERVAL = 1;

    @Test
    public void givenSampleApplicationStartedWithPassingTest_whenHealthCheckCalledBeforeTestRun_thenTooEarlyMessageReceived(){
        applicationConfigurationDropwizardTestSupport = Atam4jApplicationStarter.startApplicationWith(PassingTest.class, 1000);
        checkResponseIsOKAndWithMessage(AcceptanceTestsHealthCheck.TOO_EARLY_MESSAGE, getResponseFromHealthCheck());
    }

    @Test
    public void givenSampleApplicationStartedWithPassingTest_whenHealthCheckCalledAfterTestRUn_thenOKMessageReceived(){
        applicationConfigurationDropwizardTestSupport = Atam4jApplicationStarter.startApplicationWith(PassingTest.class, 0);

        PollingPredicate<Response> responsePollingPredicate = new PollingPredicate<Response>(MAX_ATTEMPTS, RETRY_POLL_INTERVAL,
                response -> response.readEntity(HealthCheckResult.class).getAcceptanceTestsHealthCheckResult().getMessage().equals(AcceptanceTestsHealthCheck.OK_MESSAGE),
                () -> getResponseFromHealthCheck());
        responsePollingPredicate.pollUntilPassedOrMaxAttemptsExceeded();
        checkResponseIsOKAndWithMessage(AcceptanceTestsHealthCheck.OK_MESSAGE, getResponseFromHealthCheck());
    }

}

@@ -716,32 +716,33 @@
 sageReceived()%7B%0A
+%0A
         applicat
@@ -1107,16 +1107,17 @@
 ived()%7B%0A
+%0A
         
@@ -1321,31 +1321,56 @@
 ate%3C
-Response%3E(MAX_ATTEMPTS,
+%3E(%0A                MAX_ATTEMPTS,%0A               
  RET
@@ -1459,16 +1459,41 @@
 t.class)
+%0A                        
 .getAcce
@@ -1526,21 +1526,71 @@
 lt()
-.getMessage()
+%0A                        .getMessage()%0A                        
 .equ
@@ -1653,14 +1653,14 @@
     
-() -%3E 
+this::
 getR
@@ -1677,29 +1677,28 @@
 mHealthCheck
-()
 );%0A
+%0A
         resp

Split long lines to improve readability