Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@
import java.time.temporal.ChronoUnit;

public class RequestIdPolicyTests {
static final HttpRequest HTTP_REQUEST;

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

private final HttpResponse mockResponse = new HttpResponse(null) {
@Override
Expand Down Expand Up @@ -98,8 +89,8 @@ public Mono<HttpResponse> send(HttpRequest request) {
.build();

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 Expand Up @@ -127,8 +118,8 @@ public Mono<HttpResponse> send(HttpRequest request) {
.build();

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