Skip to content

Commit

Permalink
Update htmlunit to 3.x (#2283)
Browse files Browse the repository at this point in the history
  • Loading branch information
timja authored Jun 4, 2023
1 parent 98b72d2 commit e39cab8
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertEquals;

import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.google.common.collect.ImmutableMap;
import java.util.Map;
import jenkins.model.Jenkins;
import org.htmlunit.html.HtmlPage;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package io.jenkins.plugins.casc.yaml;

import static com.gargoylesoftware.htmlunit.HttpMethod.GET;
import static org.htmlunit.HttpMethod.GET;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import com.gargoylesoftware.htmlunit.WebRequest;
import com.gargoylesoftware.htmlunit.WebResponse;
import java.io.IOException;
import java.net.URL;
import java.text.MessageFormat;
import net.sf.json.JSONObject;
import org.htmlunit.WebRequest;
import org.htmlunit.WebResponse;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.64</version>
<version>4.66</version>
<relativePath />
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package io.jenkins.plugins.casc.misc;

import static com.gargoylesoftware.htmlunit.HttpMethod.POST;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.htmlunit.HttpMethod.POST;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import com.gargoylesoftware.htmlunit.WebRequest;
import com.gargoylesoftware.htmlunit.WebResponse;
import com.gargoylesoftware.htmlunit.util.NameValuePair;
import io.jenkins.plugins.casc.ConfigurationAsCode;
import io.jenkins.plugins.casc.ConfiguratorException;
import java.io.File;
Expand All @@ -20,6 +17,9 @@
import java.util.Collections;
import java.util.logging.Level;
import org.apache.commons.io.IOUtils;
import org.htmlunit.WebRequest;
import org.htmlunit.WebResponse;
import org.htmlunit.util.NameValuePair;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.jenkins.plugins.casc;

import static com.gargoylesoftware.htmlunit.HttpMethod.POST;
import static io.jenkins.plugins.casc.ConfigurationAsCode.CASC_JENKINS_CONFIG_PROPERTY;
import static io.jenkins.plugins.casc.misc.Util.getJenkinsRoot;
import static io.jenkins.plugins.casc.misc.Util.toYamlString;
Expand All @@ -10,15 +9,11 @@
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.htmlunit.HttpMethod.POST;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import com.gargoylesoftware.htmlunit.WebRequest;
import com.gargoylesoftware.htmlunit.WebResponse;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlInput;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import hudson.Functions;
import hudson.util.FormValidation;
import io.jenkins.plugins.casc.misc.ConfiguredWithCode;
Expand All @@ -36,6 +31,11 @@
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.htmlunit.WebRequest;
import org.htmlunit.WebResponse;
import org.htmlunit.html.HtmlForm;
import org.htmlunit.html.HtmlInput;
import org.htmlunit.html.HtmlPage;
import org.junit.Assume;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -228,7 +228,7 @@ public void doReplace_should_trim_input() throws Exception {
HtmlForm form = page.getFormByName("replace");
HtmlInput input = form.getInputByName("_.newSource");
String configUri = getClass().getResource("merge3.yml").toExternalForm();
input.setValueAttribute(" " + configUri + " ");
input.setValue(" " + configUri + " ");
HtmlPage resultPage = j.submit(form);
j.assertGoodStatus(resultPage);

Expand All @@ -246,7 +246,7 @@ public void doReplace_should_support_multiple_sources() throws Exception {
" %s , %s ",
getClass().getResource("JenkinsConfigTest.yml").toExternalForm(),
getClass().getResource("folder/jenkins2.yml").toExternalForm());
input.setValueAttribute(configUri);
input.setValue(configUri);
HtmlPage resultPage = j.submit(form);
j.assertGoodStatus(resultPage);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import static org.junit.Assert.assertEquals;

import com.gargoylesoftware.htmlunit.HttpMethod;
import com.gargoylesoftware.htmlunit.WebRequest;
import io.jenkins.plugins.casc.misc.JenkinsConfiguredWithCodeRule;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import jenkins.model.Jenkins;
import org.htmlunit.HttpMethod;
import org.htmlunit.WebRequest;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package io.jenkins.plugins.casc;

import static com.gargoylesoftware.htmlunit.HttpMethod.POST;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.htmlunit.HttpMethod.POST;
import static org.junit.Assert.assertEquals;

import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.WebRequest;
import io.jenkins.plugins.casc.misc.JenkinsConfiguredWithCodeRule;
import io.jenkins.plugins.casc.yaml.YamlSource;
import io.jenkins.plugins.casc.yaml.YamlUtils;
Expand All @@ -16,6 +14,8 @@
import java.nio.file.Paths;
import java.text.MessageFormat;
import jenkins.model.Jenkins;
import org.htmlunit.FailingHttpStatusCodeException;
import org.htmlunit.WebRequest;
import org.junit.Rule;
import org.junit.Test;

Expand Down

0 comments on commit e39cab8

Please sign in to comment.