Skip to content

Commit

Permalink
wiremock with head request as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Siedlerchr committed Sep 20, 2024
1 parent 1b2a4c8 commit d6132d6
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.configureFor;
import static com.github.tomakehurst.wiremock.client.WireMock.get;
import static com.github.tomakehurst.wiremock.client.WireMock.head;
import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down Expand Up @@ -199,6 +200,12 @@ void removesHtmlFileLink(@TempDir Path tempFolder) throws Exception {
.withHeader("Content-Type", "text/html; charset=utf-8")
.withBody("<html><body><h1>Hi</h1></body></html>")));

stubFor(head(urlEqualTo("/html"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/html; charset=utf-8")
.withBody("<html><body><h1>Hi</h1></body></html>")));

LinkedFile linkedFile = new LinkedFile(new URL("http://localhost:2331/html"), "");
when(databaseContext.getFirstExistingFileDir(any())).thenReturn(Optional.of(tempFolder));
when(filePreferences.getFileNamePattern()).thenReturn("[citationkey]");
Expand Down

0 comments on commit d6132d6

Please sign in to comment.