-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix FQDN machine name mapping on proxy configuration
fix proxy configuration error display
- Loading branch information
Showing
4 changed files
with
92 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
java/code/src/com/suse/manager/ssl/test/SSLCertDataTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* Copyright (c) 2023 SUSE LLC | ||
* | ||
* This software is licensed to you under the GNU General Public License, | ||
* version 2 (GPLv2). There is NO WARRANTY for this software, express or | ||
* implied, including the implied warranties of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 | ||
* along with this software; if not, see | ||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. | ||
* | ||
* Red Hat trademarks are not licensed under GPLv2. No permission is | ||
* granted to use or replicate Red Hat trademarks that are incorporated | ||
* in this software or its documentation. | ||
*/ | ||
|
||
package com.suse.manager.ssl.test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import com.suse.manager.ssl.SSLCertData; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.MethodSource; | ||
|
||
import java.util.stream.Stream; | ||
|
||
public class SSLCertDataTest { | ||
private SSLCertData sslCertData; | ||
|
||
@BeforeEach | ||
void setUp() { | ||
sslCertData = new SSLCertData(null, null, null, null, null, null, null, null); | ||
} | ||
|
||
|
||
|
||
@ParameterizedTest | ||
@MethodSource("machineNameTestData") | ||
void testGetMachineNameWithCustomObject(SSLCertDataTestData sslCertDataTestDataIn) { | ||
sslCertData = new SSLCertData(sslCertDataTestDataIn.getCn(), null, null, null, null, null, null, null); | ||
|
||
String result = sslCertData.getMachineName(); | ||
assertEquals(sslCertDataTestDataIn.getExpectedMachineName(), result); | ||
} | ||
|
||
|
||
/** | ||
* Test the getMachineName method. | ||
* As cn is mandatory, it cannot be null nor empty. | ||
*/ | ||
private static Stream<SSLCertDataTestData> machineNameTestData() { | ||
return Stream.of( | ||
new SSLCertDataTestData("xxx.yyy.zzz.com", "xxx.yyy"), | ||
new SSLCertDataTestData("yyy.zzz.com", "yyy"), | ||
new SSLCertDataTestData("zzz.com", "zzz.com"), | ||
new SSLCertDataTestData("xxx", "xxx"), | ||
new SSLCertDataTestData("*.yyy.zzz.com", "_star_.yyy") | ||
); | ||
} | ||
|
||
static class SSLCertDataTestData { | ||
private final String cn; | ||
private final String expectedMachineName; | ||
|
||
SSLCertDataTestData(String cnIn, String expectedMachineNameIn) { | ||
this.cn = cnIn; | ||
this.expectedMachineName = expectedMachineNameIn; | ||
} | ||
|
||
String getCn() { | ||
return cn; | ||
} | ||
|
||
String getExpectedMachineName() { | ||
return expectedMachineName; | ||
} | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
java/spacewalk-java.changes.rjpmestre.fix_proxy_config_fqdn_mapping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- fix FQDN machine name mapping on proxy configuration | ||
- fix proxy configuration error display |