Skip to content

Commit

Permalink
Upgrade HtmlUnit from 2.x to 3.x (#278)
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Jacomb <timjacomb1@gmail.com>
  • Loading branch information
timja-bot and timja authored Jun 6, 2023
1 parent e29970c commit dafeae8
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.62</version>
<version>4.66</version>
<relativePath />
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.jenkins.plugins.credentials.secretsmanager.config.client.credentialsProvider;

import com.gargoylesoftware.htmlunit.html.HtmlForm;
import org.htmlunit.html.HtmlForm;
import io.jenkins.plugins.credentials.secretsmanager.config.PluginConfiguration;
import io.jenkins.plugins.credentials.secretsmanager.util.JenkinsConfiguredWithWebRule;
import io.jenkins.plugins.credentials.secretsmanager.util.PluginConfigurationForm;
Expand All @@ -27,25 +27,25 @@ protected void setDefaultCredentialsProvider() {
protected void setSTSAssumeRoleCredentialsProvider(String roleArn, String roleSessionName) {
r.configure(form -> {
setClientCredentialsProviderSelect(form,"STS AssumeRole");
form.getInputByName("_.roleArn").setValueAttribute(roleArn);
form.getInputByName("_.roleSessionName").setValueAttribute(roleSessionName);
form.getInputByName("_.roleArn").setValue(roleArn);
form.getInputByName("_.roleSessionName").setValue(roleSessionName);
});
}

@Override
protected void setProfileCredentialsProvider(String profileName) {
r.configure(form -> {
setClientCredentialsProviderSelect(form, "Profile");
form.getInputByName("_.profileName").setValueAttribute(profileName);
form.getInputByName("_.profileName").setValue(profileName);
});
}

@Override
protected void setStaticCredentialsProvider(String accessKey, String secretKey) {
r.configure(form -> {
setClientCredentialsProviderSelect(form, "Static");
form.getInputByName("_.accessKey").setValueAttribute(accessKey);
form.getInputByName("_.secretKey").setValueAttribute(secretKey);
form.getInputByName("_.accessKey").setValue(accessKey);
form.getInputByName("_.secretKey").setValue(secretKey);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected PluginConfiguration getPluginConfiguration() {
protected void setEndpointConfiguration(String serviceEndpoint, String signingRegion) {
r.configure(form -> {
form.getInputByName("_.endpointConfiguration").setChecked(true);
form.getInputByName("_.serviceEndpoint").setValueAttribute(serviceEndpoint);
form.getInputByName("_.serviceEndpoint").setValue(serviceEndpoint);
form.getSelectByName("_.signingRegion").setSelectedAttribute(signingRegion, true);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected void setFilters(Filter... filters) {
form.getSelectByName("_.key").setSelectedAttribute(filter.getKey(), true);
// TODO support multiple filter values
// this is a hack that skips the 'other' _.value input in the form
form.getInputsByName("_.value").get(0).setValueAttribute(filter.getValues().get(0).getValue());
form.getInputsByName("_.value").get(0).setValue(filter.getValues().get(0).getValue());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected void setRemovePrefix(String prefix) {

final var select = f.getDropdownList("Name");
select.getOptionByText("Remove Prefix").setSelected(true);
form.getInputByName("_.prefix").setValueAttribute(prefix);
form.getInputByName("_.prefix").setValue(prefix);
});
}

Expand All @@ -39,7 +39,7 @@ protected void setRemovePrefixes(Set<Prefix> prefixes) {

// TODO support multiple prefix values
final var firstPrefix = prefixes.stream().findFirst().get().getValue();
form.getInputsByName("_.value").get(0).setValueAttribute(firstPrefix);
form.getInputsByName("_.value").get(0).setValue(firstPrefix);
});
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package io.jenkins.plugins.credentials.secretsmanager.util;

import com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import org.htmlunit.NicelyResynchronizingAjaxController;
import org.htmlunit.html.HtmlForm;
import org.htmlunit.html.HtmlPage;

import org.jvnet.hudson.test.JenkinsRule;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package io.jenkins.plugins.credentials.secretsmanager.util;

import com.gargoylesoftware.htmlunit.html.HtmlButton;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlSelect;
import org.htmlunit.html.HtmlButton;
import org.htmlunit.html.HtmlForm;
import org.htmlunit.html.HtmlSelect;

import java.util.List;

Expand Down

0 comments on commit dafeae8

Please sign in to comment.