Skip to content

Commit

Permalink
add test for options
Browse files Browse the repository at this point in the history
  • Loading branch information
ryber committed Apr 25, 2024
1 parent 09b17f6 commit 435674c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion unirest/src/test/java/kong/unirest/core/RequestFactoryTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package kong.unirest.core;

import kong.unirest.core.json.JSONObject;
import org.assertj.core.api.AbstractAssert;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -47,6 +46,26 @@ void copy_get() {
.hasTimeout(timeout);
}

@Test
void copy_options() {
var req = Unirest.options(url)
.header(headerKey, headerValue)
.queryString(queryKey, queryValue)
.downloadMonitor(downloadMonitor)
.withObjectMapper(om)
.connectTimeout(timeout);

var copy = RequestFactory.copy(req);

assertRequest(copy)
.isInstanceOf(HttpRequestNoBody.class)
.hasHeader(headerKey, headerValue)
.hasRoute(HttpMethod.OPTIONS, urlWithQuery)
.downloadMonitorIs(downloadMonitor)
.objectMapperIs(om)
.hasTimeout(timeout);
}

@Test
void copy_head() {
var req = Unirest.head(url)
Expand Down

0 comments on commit 435674c

Please sign in to comment.