This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch 3_0_x-fixes
in repository https://gitbox.apache.org/repos/asf/ws-wss4j.git
The following commit(s) were added to refs/heads/3_0_x-fixes by this push:
new ad0eabdf8 Fixing some useless parameter warnings in the tests (#752)
ad0eabdf8 is described below
commit ad0eabdf86a1c2e68c8038746c33736a54b013ac
Author: Colm O hEigeartaigh <[email protected]>
AuthorDate: Wed Oct 14 05:54:09 2026 +0100
Fixing some useless parameter warnings in the tests (#752)
---
.../policy/stax/test/AbstractPolicyTestBase.java | 2 +-
.../policy/stax/test/SupportingTokensTest.java | 16 ++++++-------
.../apache/wss4j/stax/test/AbstractTestBase.java | 4 ++--
.../wss4j/stax/test/DerivedKeyTokenTest.java | 26 +++++++++-------------
.../wss4j/stax/test/InteroperabilityTest.java | 2 +-
.../wss4j/stax/test/SecurityContextTokenTest.java | 11 +++++----
6 files changed, 28 insertions(+), 33 deletions(-)
diff --git
a/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/AbstractPolicyTestBase.java
b/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/AbstractPolicyTestBase.java
index 5a1a14a8c..c1f79f1a5 100644
---
a/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/AbstractPolicyTestBase.java
+++
b/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/AbstractPolicyTestBase.java
@@ -153,7 +153,7 @@ public class AbstractPolicyTestBase extends
AbstractTestBase {
return x509SecurityToken;
}
- public KerberosServiceSecurityTokenImpl
getKerberosServiceSecurityToken(WSSecurityTokenConstants.TokenType tokenType)
throws Exception {
+ public KerberosServiceSecurityTokenImpl getKerberosServiceSecurityToken()
throws Exception {
return new KerberosServiceSecurityTokenImpl(
null, null, null, null, IDGenerator.generateID(null),
WSSecurityTokenConstants.KEYIDENTIFIER_SECURITY_TOKEN_DIRECT_REFERENCE);
diff --git
a/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SupportingTokensTest.java
b/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SupportingTokensTest.java
index 9601e0658..df3eb82f0 100644
---
a/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SupportingTokensTest.java
+++
b/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SupportingTokensTest.java
@@ -609,14 +609,14 @@ public class SupportingTokensTest extends
AbstractPolicyTestBase {
KerberosTokenSecurityEvent tokenSecurityEvent = new
KerberosTokenSecurityEvent();
tokenSecurityEvent.setIssuerName("CN=transmitter,OU=swssf,C=CH");
- KerberosServiceSecurityTokenImpl kerberosServiceSecurityToken =
getKerberosServiceSecurityToken(WSSecurityTokenConstants.KERBEROS_TOKEN);
+ KerberosServiceSecurityTokenImpl kerberosServiceSecurityToken =
getKerberosServiceSecurityToken();
kerberosServiceSecurityToken.addTokenUsage(WSSecurityTokenConstants.TOKENUSAGE_SUPPORTING_TOKENS);
tokenSecurityEvent.setSecurityToken(kerberosServiceSecurityToken);
policyEnforcer.registerSecurityEvent(tokenSecurityEvent);
tokenSecurityEvent = new KerberosTokenSecurityEvent();
tokenSecurityEvent.setIssuerName("CN=transmitter,OU=swssf,C=CH");
- kerberosServiceSecurityToken =
getKerberosServiceSecurityToken(WSSecurityTokenConstants.KERBEROS_TOKEN);
+ kerberosServiceSecurityToken = getKerberosServiceSecurityToken();
kerberosServiceSecurityToken.addTokenUsage(WSSecurityTokenConstants.TOKENUSAGE_SUPPORTING_TOKENS);
tokenSecurityEvent.setSecurityToken(kerberosServiceSecurityToken);
policyEnforcer.registerSecurityEvent(tokenSecurityEvent);
@@ -644,14 +644,14 @@ public class SupportingTokensTest extends
AbstractPolicyTestBase {
KerberosTokenSecurityEvent tokenSecurityEvent = new
KerberosTokenSecurityEvent();
tokenSecurityEvent.setIssuerName("test");
- KerberosServiceSecurityTokenImpl kerberosServiceSecurityToken =
getKerberosServiceSecurityToken(WSSecurityTokenConstants.KERBEROS_TOKEN);
+ KerberosServiceSecurityTokenImpl kerberosServiceSecurityToken =
getKerberosServiceSecurityToken();
kerberosServiceSecurityToken.addTokenUsage(WSSecurityTokenConstants.TOKENUSAGE_SUPPORTING_TOKENS);
tokenSecurityEvent.setSecurityToken(kerberosServiceSecurityToken);
policyEnforcer.registerSecurityEvent(tokenSecurityEvent);
tokenSecurityEvent = new KerberosTokenSecurityEvent();
tokenSecurityEvent.setIssuerName("test");
- kerberosServiceSecurityToken =
getKerberosServiceSecurityToken(WSSecurityTokenConstants.KERBEROS_TOKEN);
+ kerberosServiceSecurityToken = getKerberosServiceSecurityToken();
kerberosServiceSecurityToken.addTokenUsage(WSSecurityTokenConstants.TOKENUSAGE_SUPPORTING_TOKENS);
tokenSecurityEvent.setSecurityToken(kerberosServiceSecurityToken);
policyEnforcer.registerSecurityEvent(tokenSecurityEvent);
@@ -683,14 +683,14 @@ public class SupportingTokensTest extends
AbstractPolicyTestBase {
KerberosTokenSecurityEvent tokenSecurityEvent = new
KerberosTokenSecurityEvent();
tokenSecurityEvent.setIssuerName("CN=transmitter,OU=swssf,C=CH");
- KerberosServiceSecurityTokenImpl kerberosServiceSecurityToken =
getKerberosServiceSecurityToken(WSSecurityTokenConstants.KERBEROS_TOKEN);
+ KerberosServiceSecurityTokenImpl kerberosServiceSecurityToken =
getKerberosServiceSecurityToken();
kerberosServiceSecurityToken.addTokenUsage(WSSecurityTokenConstants.TOKENUSAGE_SUPPORTING_TOKENS);
tokenSecurityEvent.setSecurityToken(kerberosServiceSecurityToken);
policyEnforcer.registerSecurityEvent(tokenSecurityEvent);
tokenSecurityEvent = new KerberosTokenSecurityEvent();
tokenSecurityEvent.setIssuerName("test");
- kerberosServiceSecurityToken =
getKerberosServiceSecurityToken(WSSecurityTokenConstants.KERBEROS_TOKEN);
+ kerberosServiceSecurityToken = getKerberosServiceSecurityToken();
kerberosServiceSecurityToken.addTokenUsage(WSSecurityTokenConstants.TOKENUSAGE_SUPPORTING_TOKENS);
tokenSecurityEvent.setSecurityToken(kerberosServiceSecurityToken);
policyEnforcer.registerSecurityEvent(tokenSecurityEvent);
@@ -718,14 +718,14 @@ public class SupportingTokensTest extends
AbstractPolicyTestBase {
KerberosTokenSecurityEvent tokenSecurityEvent = new
KerberosTokenSecurityEvent();
tokenSecurityEvent.setIssuerName("test");
- KerberosServiceSecurityTokenImpl kerberosServiceSecurityToken =
getKerberosServiceSecurityToken(WSSecurityTokenConstants.KERBEROS_TOKEN);
+ KerberosServiceSecurityTokenImpl kerberosServiceSecurityToken =
getKerberosServiceSecurityToken();
kerberosServiceSecurityToken.addTokenUsage(WSSecurityTokenConstants.TOKENUSAGE_SUPPORTING_TOKENS);
tokenSecurityEvent.setSecurityToken(kerberosServiceSecurityToken);
policyEnforcer.registerSecurityEvent(tokenSecurityEvent);
tokenSecurityEvent = new KerberosTokenSecurityEvent();
tokenSecurityEvent.setIssuerName("CN=transmitter,OU=swssf,C=CH");
- kerberosServiceSecurityToken =
getKerberosServiceSecurityToken(WSSecurityTokenConstants.KERBEROS_TOKEN);
+ kerberosServiceSecurityToken = getKerberosServiceSecurityToken();
kerberosServiceSecurityToken.addTokenUsage(WSSecurityTokenConstants.TOKENUSAGE_SUPPORTING_TOKENS);
tokenSecurityEvent.setSecurityToken(kerberosServiceSecurityToken);
policyEnforcer.registerSecurityEvent(tokenSecurityEvent);
diff --git
a/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java
b/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java
index 955f1df8f..a6d9939e3 100644
---
a/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java
+++
b/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java
@@ -364,7 +364,7 @@ public abstract class AbstractTestBase {
return xPath.compile(expression);
}
- class CustomWSS4JHandler extends WSHandler {
+ static class CustomWSS4JHandler extends WSHandler {
private final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(CustomWSS4JHandler.class.getName());
@@ -622,7 +622,7 @@ public abstract class AbstractTestBase {
}
}
- protected class TestSecurityEventListener implements SecurityEventListener
{
+ protected static class TestSecurityEventListener implements
SecurityEventListener {
private SecurityEventConstants.Event[] expectedEvents;
private List<SecurityEvent> receivedSecurityEvents = new ArrayList<>();
diff --git
a/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/DerivedKeyTokenTest.java
b/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/DerivedKeyTokenTest.java
index db52ac9c2..5375e0d5a 100644
---
a/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/DerivedKeyTokenTest.java
+++
b/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/DerivedKeyTokenTest.java
@@ -65,6 +65,7 @@ import
org.apache.xml.security.stax.securityEvent.SecurityEvent;
import org.apache.xml.security.stax.securityEvent.SecurityEventConstants;
import org.apache.xml.security.stax.securityEvent.SignatureValueSecurityEvent;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.w3c.dom.Attr;
@@ -80,9 +81,8 @@ public class DerivedKeyTokenTest extends AbstractTestBase {
WSSConfig.init();
}
- @ParameterizedTest
- @ValueSource(ints = {ConversationConstants.VERSION_05_02,
ConversationConstants.VERSION_05_12})
- public void testEncryptionDecryptionTRIPLEDESOutbound(int version) throws
Exception {
+ @Test
+ public void testEncryptionDecryptionTRIPLEDESOutbound() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
{
WSSSecurityProperties securityProperties = new
WSSSecurityProperties();
@@ -113,9 +113,8 @@ public class DerivedKeyTokenTest extends AbstractTestBase {
}
}
- @ParameterizedTest
- @ValueSource(ints = {ConversationConstants.VERSION_05_02,
ConversationConstants.VERSION_05_12})
- public void testEncryptionDecryptionOutboundDeprecatedTag(int version)
throws Exception {
+ @Test
+ public void testEncryptionDecryptionOutboundDeprecatedTag() throws
Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
{
WSSSecurityProperties securityProperties = new
WSSSecurityProperties();
@@ -318,9 +317,8 @@ public class DerivedKeyTokenTest extends AbstractTestBase {
}
}
- @ParameterizedTest
- @ValueSource(ints = {ConversationConstants.VERSION_05_02,
ConversationConstants.VERSION_05_12})
- public void testEncryptionDecryptionAES128Outbound(int version) throws
Exception {
+ @Test
+ public void testEncryptionDecryptionAES128Outbound() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
{
WSSSecurityProperties securityProperties = new
WSSSecurityProperties();
@@ -580,9 +578,8 @@ public class DerivedKeyTokenTest extends AbstractTestBase {
}
}
- @ParameterizedTest
- @ValueSource(ints = {ConversationConstants.VERSION_05_02,
ConversationConstants.VERSION_05_12})
- public void testSignatureThumbprintSHA1Outbound(int version) throws
Exception {
+ @Test
+ public void testSignatureThumbprintSHA1Outbound() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
{
WSSSecurityProperties securityProperties = new
WSSSecurityProperties();
@@ -848,9 +845,8 @@ public class DerivedKeyTokenTest extends AbstractTestBase {
}
}
- @ParameterizedTest
- @ValueSource(ints = {ConversationConstants.VERSION_05_02,
ConversationConstants.VERSION_05_12})
- public void testSignatureEncryptOutbound(int version) throws Exception {
+ @Test
+ public void testSignatureEncryptOutbound() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
{
WSSSecurityProperties securityProperties = new
WSSSecurityProperties();
diff --git
a/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/InteroperabilityTest.java
b/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/InteroperabilityTest.java
index b633b021f..626d84f63 100644
---
a/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/InteroperabilityTest.java
+++
b/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/InteroperabilityTest.java
@@ -1364,7 +1364,7 @@ public class InteroperabilityTest extends
AbstractTestBase {
return null;
}
- class NodeIndex {
+ static class NodeIndex {
Node node;
int index;
}
diff --git
a/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SecurityContextTokenTest.java
b/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SecurityContextTokenTest.java
index 55fb08199..05bfc30f0 100644
---
a/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SecurityContextTokenTest.java
+++
b/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SecurityContextTokenTest.java
@@ -67,6 +67,7 @@ import
org.apache.xml.security.stax.securityEvent.SecurityEvent;
import org.apache.xml.security.stax.securityEvent.SignatureValueSecurityEvent;
import org.apache.xml.security.stax.securityToken.InboundSecurityToken;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.w3c.dom.Document;
@@ -82,9 +83,8 @@ public class SecurityContextTokenTest extends
AbstractTestBase {
WSSConfig.init();
}
- @ParameterizedTest
- @ValueSource(ints = {ConversationConstants.VERSION_05_02,
ConversationConstants.VERSION_05_12})
- public void testSCTDKTEncryptOutbound(int version) throws Exception {
+ @Test
+ public void testSCTDKTEncryptOutbound() throws Exception {
byte[] secret = WSSConstants.generateBytes(128 / 8);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -294,9 +294,8 @@ public class SecurityContextTokenTest extends
AbstractTestBase {
}
}
- @ParameterizedTest
- @ValueSource(ints = {ConversationConstants.VERSION_05_02,
ConversationConstants.VERSION_05_12})
- public void testSCTKDKTSignOutbound(int version) throws Exception {
+ @Test
+ public void testSCTKDKTSignOutbound() throws Exception {
byte[] secret = WSSConstants.generateBytes(128 / 8);
ByteArrayOutputStream baos = new ByteArrayOutputStream();