You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2026/10/13 09:48:35 UTC
(ws-wss4j) 01/01: Fixing some useless parameter warnings in the tests
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch coheigea/javadoc-tests
in repository https://gitbox.apache.org/repos/asf/ws-wss4j.git
commit 7013c5ec0acd9c4a25154d601c0fe77b643caedd
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Tue Oct 13 10:48:05 2026 +0100
Fixing some useless parameter warnings in the tests
---
.../policy/stax/test/AbstractPolicyTestBase.java | 2 +-
.../policy/stax/test/SupportingTokensTest.java | 16 ++++++-------
.../wss4j/stax/test/DerivedKeyTokenTest.java | 26 +++++++++-------------
.../wss4j/stax/test/SecurityContextTokenTest.java | 11 +++++----
4 files changed, 25 insertions(+), 30 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/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/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();