mirror of
https://github.com/s4u/maven-settings-action.git
synced 2026-02-18 00:00:26 +08:00
#279 adding auth details for proxy
This commit is contained in:
committed by
Slawomir Jaranowski
parent
45ea8e67c7
commit
06520eb502
@ -466,6 +466,26 @@ test("fillProxies one proxy", () => {
|
||||
|
||||
})
|
||||
|
||||
test("fillProxies one proxy with auth info", () => {
|
||||
const xml = stringAsXml("<proxies/>");
|
||||
|
||||
process.env['INPUT_PROXIES'] = `[{"id": "proxyId", "active": "isActive", "protocol": "proxyProtocol",
|
||||
"host": "proxyHost", "port": "proxyPort", "nonProxyHosts": "nonProxyHost", "user": "proxyUser", "password": "somepassword"}]`;
|
||||
|
||||
settings.fillProxies(xml);
|
||||
|
||||
const xmlStr = new XMLSerializer().serializeToString(xml);
|
||||
expect(xmlStr).toBe(`<proxies><proxy>
|
||||
<id>proxyId</id>
|
||||
<active>isActive</active>
|
||||
<protocol>proxyProtocol</protocol>
|
||||
<host>proxyHost</host>
|
||||
<port>proxyPort</port>
|
||||
<nonProxyHosts>nonProxyHost</nonProxyHosts>
|
||||
<username>proxyUser</username><password>somepassword</password></proxy></proxies>`)
|
||||
|
||||
})
|
||||
|
||||
test("fillProxies two proxies", () => {
|
||||
const xml = stringAsXml("<proxies/>");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user