Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,21 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

public class ProtocolPolicyTests {
static final HttpRequest HTTP_REQUEST;

static {
try {
HTTP_REQUEST = createHttpRequest("https://www.bing.com");
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
}

@SyncAsyncTest
public void withOverwrite() throws Exception {
final HttpPipeline pipeline = createPipeline("ftp", "ftp://www.bing.com");
SyncAsyncExtension.execute(
() -> pipeline.sendSync(HTTP_REQUEST, Context.NONE),
() -> pipeline.send(HTTP_REQUEST)
() -> pipeline.sendSync(createHttpRequest("https://www.bing.com"), Context.NONE),
() -> pipeline.send(createHttpRequest("https://www.bing.com"))
);
}

@SyncAsyncTest
public void withNoOverwrite() throws Exception {
final HttpPipeline pipeline = createPipeline("ftp", false, "https://www.bing.com");
SyncAsyncExtension.execute(
() -> pipeline.sendSync(HTTP_REQUEST, Context.NONE),
() -> pipeline.send(HTTP_REQUEST)
() -> pipeline.sendSync(createHttpRequest("https://www.bing.com"), Context.NONE),
() -> pipeline.send(createHttpRequest("https://www.bing.com"))
);
}

Expand Down