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 24, 2024
1 parent 09b17f6 commit e6d0c19
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions unirest/src/test/java/kong/unirest/core/RequestFactoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,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 e6d0c19

Please sign in to comment.