Projects >> rest-driver >>a976984a630e881ddb4af1d480abdefb04bb2122

Chunk
Conflicting content
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;

<<<<<<< HEAD
import org.hamcrest.Matcher;
=======
import com.github.restdriver.clientdriver.capture.BodyCapture;
>>>>>>> b74067d69d4d4be9cb871970b9817880081bba7b

/**
 * Helper class for fluent creation of Client Driver objects.
Solution content
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;

import org.hamcrest.Matcher;
import com.github.restdriver.clientdriver.capture.BodyCapture;

/**
 * Helper class for fluent creation of Client Driver objects.
File
RestClientDriver.java
Developer's decision
Concatenation
Kind of conflict
Import
Chunk
Conflicting content
    public void giveEmptyResponseWorks() {
        assertThat(giveEmptyResponse().getContent(), is(""));
    }
<<<<<<< HEAD
    
=======

    @Test
    public void waitForReturnsImmediatelyIfCaptureBodyPopulated() throws Exception {
        long start = System.currentTimeMillis();
        StringBodyCapture bodyCapture = new StringBodyCapture();
        bodyCapture.setBody("some body");

        waitFor(bodyCapture, 5, TimeUnit.SECONDS);

        assertThat(System.currentTimeMillis() - start, lessThan(100L));
    }

    @Test
    public void waitForSpecifiedTimeIfCaptureBodyIsNotPopulated() throws Exception {
        long start = System.currentTimeMillis();
        StringBodyCapture bodyCapture = new StringBodyCapture();

        waitFor(bodyCapture, 1, TimeUnit.SECONDS);

        assertThat(System.currentTimeMillis() - start, greaterThan(1000L));
    }
>>>>>>> b74067d69d4d4be9cb871970b9817880081bba7b
}
Solution content
    public void giveEmptyResponseWorks() {
        assertThat(giveEmptyResponse().getContent(), is(""));
    }

    @Test
    public void waitForReturnsImmediatelyIfCaptureBodyPopulated() throws Exception {
        long start = System.currentTimeMillis();
        StringBodyCapture bodyCapture = new StringBodyCapture();
        bodyCapture.setBody("some body");

        waitFor(bodyCapture, 5, TimeUnit.SECONDS);

        assertThat(System.currentTimeMillis() - start, lessThan(100L));
    }

    @Test
    public void waitForSpecifiedTimeIfCaptureBodyIsNotPopulated() throws Exception {
        long start = System.currentTimeMillis();
        StringBodyCapture bodyCapture = new StringBodyCapture();

        waitFor(bodyCapture, 1, TimeUnit.SECONDS);

        assertThat(System.currentTimeMillis() - start, greaterThan(1000L));
    }

}
File
RestClientDriverTest.java
Developer's decision
Version 2
Kind of conflict
Annotation
Method declaration