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 2019/01/03 11:48:58 UTC
svn commit: r1850227 [2/11] - in /webservices/wss4j/trunk: build-tools/
integration/src/test/java/org/apache/wss4j/integration/test/kerberos/
performance/src/test/java/org/apache/wss4j/performance/
policy/src/test/java/org/apache/wss4j/policy/tests/ ws...
Modified: webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/AuthorityKeyIdentifierTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/AuthorityKeyIdentifierTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/AuthorityKeyIdentifierTest.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/AuthorityKeyIdentifierTest.java Thu Jan 3 11:48:56 2019
@@ -28,11 +28,15 @@ import org.apache.wss4j.common.ext.WSSec
import org.apache.wss4j.common.util.Loader;
import org.junit.Test;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* This is a test for extracting AuthorityKeyIdentifier/SubjectKeyIdentifier information from
* the certs using BouncyCastle.
*/
-public class AuthorityKeyIdentifierTest extends org.junit.Assert {
+public class AuthorityKeyIdentifierTest {
public AuthorityKeyIdentifierTest() {
WSProviderConfig.init();
@@ -106,4 +110,4 @@ public class AuthorityKeyIdentifierTest
return keyStore;
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/NameConstraintsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/NameConstraintsTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/NameConstraintsTest.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/NameConstraintsTest.java Thu Jan 3 11:48:56 2019
@@ -19,6 +19,7 @@
package org.apache.wss4j.common.crypto;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
@@ -41,6 +42,9 @@ import org.apache.wss4j.common.util.Load
import org.junit.Before;
import org.junit.Test;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
/**
* Tests the handling of {@code NameConstraint}s with {@code TrustAnchor}s in the
* {@link Merlin}, {@link MerlinAKI}, and {@link CertificateStore} crypto implementations.
@@ -55,7 +59,7 @@ import org.junit.Test;
* null Name Constraints added</li>
* </ul>
*/
-public class NameConstraintsTest extends org.junit.Assert {
+public class NameConstraintsTest {
private static final String KEY_ROOT = "keys/nameconstraints/";
private static final String SELF_SIGNED = KEY_ROOT + "self_signed.p12";
Modified: webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/PasswordEncryptorTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/PasswordEncryptorTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/PasswordEncryptorTest.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/PasswordEncryptorTest.java Thu Jan 3 11:48:56 2019
@@ -21,10 +21,13 @@ package org.apache.wss4j.common.crypto;
import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+
/**
* This is a test for the PasswordEncryptor interface
*/
-public class PasswordEncryptorTest extends org.junit.Assert {
+public class PasswordEncryptorTest {
@Test
public void testStrongJasyptPasswordEncryptor() throws Exception {
@@ -37,4 +40,4 @@ public class PasswordEncryptorTest exten
assertEquals(decryptedPassword, "password");
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/SKITest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/SKITest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/SKITest.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/SKITest.java Thu Jan 3 11:48:56 2019
@@ -28,6 +28,9 @@ import org.apache.wss4j.common.util.Load
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.junit.Test;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
/**
* This is a test for WSS-300 - "SubjectKeyIdentifier (SKI) incorrectly calculated for 2048-bit RSA key".
* The SKI value WSS4J generates for various key sizes is tested against the output from openssl, e.g.:
@@ -35,7 +38,7 @@ import org.junit.Test;
* openssl x509 -inform der -ocspid -in wss40_server.crt | grep 'Public key OCSP hash'
* | perl -ne 'split; print pack("H*",$_[4])' | base64
*/
-public class SKITest extends org.junit.Assert {
+public class SKITest {
@Test
public void testRSA1024() throws Exception {
@@ -91,4 +94,4 @@ public class SKITest extends org.junit.A
Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
}
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CertificateStoreTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CertificateStoreTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CertificateStoreTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CertificateStoreTest.java Thu Jan 3 11:48:56 2019
@@ -46,11 +46,15 @@ import java.util.List;
import javax.security.auth.callback.CallbackHandler;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* This is a test for the CertificateStore Crypto instance. This class does not know anything
* about Java KeyStores, but just wraps a list of trusted certificates.
*/
-public class CertificateStoreTest extends org.junit.Assert {
+public class CertificateStoreTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(CertificateStoreTest.class);
private WSSecurityEngine secEngine = new WSSecurityEngine();
@@ -296,4 +300,4 @@ public class CertificateStoreTest extend
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoProviderTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoProviderTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoProviderTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoProviderTest.java Thu Jan 3 11:48:56 2019
@@ -44,6 +44,9 @@ import java.security.Security;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* This is a test for WSS-86 - "CryptoBase.splitAndTrim does not take into account the format of a
* DN constructed by different providers":
@@ -57,7 +60,7 @@ import java.security.cert.X509Certificat
* -dname "1.2.840.113549.1.9.1=#16125765726e6572406578616d706c652e636f6d,CN=Werner,
* OU=WSS4J,O=Apache,L=Munich,ST=Bayern,C=DE"
*/
-public class CryptoProviderTest extends org.junit.Assert {
+public class CryptoProviderTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(CryptoProviderTest.class);
private WSSecurityEngine secEngine = new WSSecurityEngine();
@@ -291,4 +294,4 @@ public class CryptoProviderTest extends
}
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoTest.java Thu Jan 3 11:48:56 2019
@@ -39,7 +39,12 @@ import org.apache.wss4j.dom.message.WSSe
import org.junit.Test;
import org.w3c.dom.Document;
-public class CryptoTest extends org.junit.Assert {
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+public class CryptoTest {
public CryptoTest() {
WSSConfig.init();
@@ -167,4 +172,4 @@ public class CryptoTest extends org.juni
super(null, null, null);
}
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/WSSConfigTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/WSSConfigTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/WSSConfigTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/WSSConfigTest.java Thu Jan 3 11:48:56 2019
@@ -25,10 +25,13 @@ import org.apache.wss4j.common.crypto.WS
import org.apache.wss4j.dom.engine.WSSConfig;
import org.junit.Test;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
/**
* Test loading and removing security providers via WSSConfig
*/
-public class WSSConfigTest extends org.junit.Assert {
+public class WSSConfigTest {
@Test
public void testWSSConfig() {
@@ -75,4 +78,4 @@ public class WSSConfigTest extends org.j
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CallbackRefTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CallbackRefTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CallbackRefTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CallbackRefTest.java Thu Jan 3 11:48:56 2019
@@ -33,12 +33,14 @@ import org.w3c.dom.Document;
import javax.security.auth.callback.CallbackHandler;
+import static org.junit.Assert.assertTrue;
+
/**
* Test case for WSS-245 - "WSHandlerConstants.PW_CALLBACK_REF isn't correctly searched for"
*
* https://issues.apache.org/jira/browse/WSS-245
*/
-public class CallbackRefTest extends org.junit.Assert {
+public class CallbackRefTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(CallbackRefTest.class);
private CallbackHandler callbackHandler = new UsernamePasswordCallbackHandler();
@@ -126,4 +128,4 @@ public class CallbackRefTest extends org
assertTrue(outputString.contains("securityPassword"));
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CustomActionProcessorTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CustomActionProcessorTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CustomActionProcessorTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CustomActionProcessorTest.java Thu Jan 3 11:48:56 2019
@@ -41,11 +41,15 @@ import org.w3c.dom.Document;
import java.util.Collections;
import java.util.List;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* A test for adding custom actions/processors etc.
*/
-public class CustomActionProcessorTest extends org.junit.Assert {
+public class CustomActionProcessorTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(CustomActionProcessorTest.class);
private Crypto crypto;
@@ -268,4 +272,4 @@ public class CustomActionProcessorTest e
}
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CustomTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CustomTokenTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CustomTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CustomTokenTest.java Thu Jan 3 11:48:56 2019
@@ -43,11 +43,13 @@ import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import static org.junit.Assert.assertNotNull;
+
/**
* A test to add a Custom Token to an outbound message
*/
-public class CustomTokenTest extends org.junit.Assert {
+public class CustomTokenTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(CustomTokenTest.class);
@@ -131,4 +133,4 @@ public class CustomTokenTest extends org
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/ResultsOrderTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/ResultsOrderTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/ResultsOrderTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/ResultsOrderTest.java Thu Jan 3 11:48:56 2019
@@ -25,12 +25,15 @@ import org.apache.wss4j.dom.common.Secur
import org.apache.wss4j.dom.engine.WSSecurityEngineResult;
import org.junit.Test;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
/**
* This is a test for WSS-147. A "checkReceiverResultsAnyOrder" method is added to WSHandler
* which applications can use if they want.
*/
-public class ResultsOrderTest extends org.junit.Assert {
+public class ResultsOrderTest {
@org.junit.AfterClass
public static void cleanup() throws Exception {
@@ -283,4 +286,4 @@ public class ResultsOrderTest extends or
assertFalse(handler.checkResultsAnyOrder(results, actions));
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SecurityActionTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SecurityActionTokenTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SecurityActionTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SecurityActionTokenTest.java Thu Jan 3 11:48:56 2019
@@ -54,7 +54,7 @@ import org.w3c.dom.Document;
/**
* This is a set of tests for using SecurityActionTokens to configure various Actions.
*/
-public class SecurityActionTokenTest extends org.junit.Assert {
+public class SecurityActionTokenTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(SecurityActionTokenTest.class);
private WSSecurityEngine secEngine = new WSSecurityEngine();
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureConfirmationTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureConfirmationTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureConfirmationTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureConfirmationTest.java Thu Jan 3 11:48:56 2019
@@ -45,10 +45,15 @@ import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* A set of test-cases for SignatureConfirmation.
*/
-public class SignatureConfirmationTest extends org.junit.Assert {
+public class SignatureConfirmationTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(SignatureConfirmationTest.class);
private WSSecurityEngine secEngine = new WSSecurityEngine();
@@ -330,4 +335,4 @@ public class SignatureConfirmationTest e
return results;
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureUTAliasTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureUTAliasTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureUTAliasTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureUTAliasTest.java Thu Jan 3 11:48:56 2019
@@ -44,7 +44,7 @@ import org.w3c.dom.Document;
* This is a test for WSS-194 - "Support overriding KeyStore alias for signature so that it can
* be different than user name used for UsernameToken".
*/
-public class SignatureUTAliasTest extends org.junit.Assert implements CallbackHandler {
+public class SignatureUTAliasTest implements CallbackHandler {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(SignatureUTAliasTest.class);
private WSSecurityEngine secEngine = new WSSecurityEngine();
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/UseReqSigCertTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/UseReqSigCertTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/UseReqSigCertTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/UseReqSigCertTest.java Thu Jan 3 11:48:56 2019
@@ -40,7 +40,7 @@ import org.w3c.dom.Document;
* Some tests for WSHandlerConstants.USE_REQ_SIG_CERT - the user signature cert is used to
* encrypt the response.
*/
-public class UseReqSigCertTest extends org.junit.Assert {
+public class UseReqSigCertTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(UseReqSigCertTest.class);
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/WSHandlerGetPasswordTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/WSHandlerGetPasswordTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/WSHandlerGetPasswordTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/WSHandlerGetPasswordTest.java Thu Jan 3 11:48:56 2019
@@ -34,11 +34,13 @@ import org.w3c.dom.Document;
import javax.security.auth.callback.CallbackHandler;
+import static org.junit.Assert.assertTrue;
+
/**
* WS-Security Test Case for the getPassword method in WSHandler.
* <p/>
*/
-public class WSHandlerGetPasswordTest extends org.junit.Assert {
+public class WSHandlerGetPasswordTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(WSHandlerGetPasswordTest.class);
private CallbackHandler callbackHandler = new UsernamePasswordCallbackHandler();
@@ -152,4 +154,4 @@ public class WSHandlerGetPasswordTest ex
assertTrue(outputString.contains("securityPassword"));
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentTest.java Thu Jan 3 11:48:56 2019
@@ -52,13 +52,17 @@ import org.apache.wss4j.dom.engine.WSSCo
import org.apache.wss4j.dom.engine.WSSecurityEngine;
import org.apache.wss4j.dom.handler.RequestData;
import org.apache.wss4j.dom.handler.WSHandlerResult;
-import org.junit.Assert;
import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
-public class AttachmentTest extends Assert {
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+public class AttachmentTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(AttachmentTest.class);
@@ -126,17 +130,17 @@ public class AttachmentTest extends Asse
}
NodeList sigReferences = signedDoc.getElementsByTagNameNS(WSConstants.SIG_NS, "Reference");
- Assert.assertEquals(2, sigReferences.getLength());
+ assertEquals(2, sigReferences.getLength());
attachmentCallbackHandler =
new AttachmentCallbackHandler(Collections.singletonList(attachment));
verify(signedDoc, attachmentCallbackHandler);
- Assert.assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
+ assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
Attachment responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(0);
byte[] attachmentBytes = readInputStream(responseAttachment.getSourceStream());
- Assert.assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
- Assert.assertEquals("text/xml", responseAttachment.getMimeType());
+ assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
+ assertEquals("text/xml", responseAttachment.getMimeType());
}
@Test
@@ -190,9 +194,9 @@ public class AttachmentTest extends Asse
}
}
});
- Assert.fail();
+ fail();
} catch (WSSecurityException e) {
- Assert.assertEquals(e.getMessage(), "The signature or decryption was invalid");
+ assertEquals(e.getMessage(), "The signature or decryption was invalid");
}
}
@@ -229,17 +233,17 @@ public class AttachmentTest extends Asse
}
NodeList sigReferences = signedDoc.getElementsByTagNameNS(WSConstants.SIG_NS, "Reference");
- Assert.assertEquals(2, sigReferences.getLength());
+ assertEquals(2, sigReferences.getLength());
attachmentCallbackHandler =
new AttachmentCallbackHandler(Collections.singletonList(attachment));
verify(signedDoc, attachmentCallbackHandler);
- Assert.assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
+ assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
Attachment responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(0);
byte[] attachmentBytes = readInputStream(responseAttachment.getSourceStream());
- Assert.assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
- Assert.assertEquals("text/xml", responseAttachment.getMimeType());
+ assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
+ assertEquals("text/xml", responseAttachment.getMimeType());
}
@Test
@@ -292,9 +296,9 @@ public class AttachmentTest extends Asse
}
}
});
- Assert.fail();
+ fail();
} catch (WSSecurityException e) {
- Assert.assertEquals(e.getMessage(), "The signature or decryption was invalid");
+ assertEquals(e.getMessage(), "The signature or decryption was invalid");
}
}
@@ -339,21 +343,21 @@ public class AttachmentTest extends Asse
}
NodeList sigReferences = signedDoc.getElementsByTagNameNS(WSConstants.SIG_NS, "Reference");
- Assert.assertEquals(3, sigReferences.getLength());
+ assertEquals(3, sigReferences.getLength());
attachmentCallbackHandler = new AttachmentCallbackHandler(Arrays.asList(attachment));
verify(signedDoc, attachmentCallbackHandler);
- Assert.assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
+ assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
Attachment responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(0);
byte[] attachment1Bytes = readInputStream(responseAttachment.getSourceStream());
- Assert.assertTrue(Arrays.equals(attachment1Bytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
- Assert.assertEquals("text/xml", responseAttachment.getMimeType());
+ assertTrue(Arrays.equals(attachment1Bytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
+ assertEquals("text/xml", responseAttachment.getMimeType());
responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(1);
byte[] attachment2Bytes = readInputStream(responseAttachment.getSourceStream());
- Assert.assertTrue(Arrays.equals(attachment2Bytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
- Assert.assertEquals("text/plain", responseAttachment.getMimeType());
+ assertTrue(Arrays.equals(attachment2Bytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
+ assertEquals("text/plain", responseAttachment.getMimeType());
}
@Test
@@ -389,30 +393,30 @@ public class AttachmentTest extends Asse
}
NodeList references = doc.getElementsByTagNameNS(WSConstants.ENC_NS, "DataReference");
- Assert.assertEquals(2, references.getLength());
+ assertEquals(2, references.getLength());
NodeList cipherReferences = doc.getElementsByTagNameNS(WSConstants.ENC_NS, "CipherReference");
- Assert.assertEquals(1, cipherReferences.getLength());
+ assertEquals(1, cipherReferences.getLength());
NodeList encDatas = doc.getElementsByTagNameNS(WSConstants.ENC_NS, "EncryptedData");
- Assert.assertEquals(2, encDatas.getLength());
+ assertEquals(2, encDatas.getLength());
NodeList securityHeaderElement = doc.getElementsByTagNameNS(WSConstants.WSSE_NS, "Security");
- Assert.assertEquals(1, securityHeaderElement.getLength());
+ assertEquals(1, securityHeaderElement.getLength());
NodeList childs = securityHeaderElement.item(0).getChildNodes();
- Assert.assertEquals(2, childs.getLength());
- Assert.assertEquals(childs.item(0).getLocalName(), "EncryptedKey");
- Assert.assertEquals(childs.item(1).getLocalName(), "EncryptedData");
+ assertEquals(2, childs.getLength());
+ assertEquals(childs.item(0).getLocalName(), "EncryptedKey");
+ assertEquals(childs.item(1).getLocalName(), "EncryptedData");
attachmentCallbackHandler = new AttachmentCallbackHandler(encryptedAttachments);
verify(encryptedDoc, attachmentCallbackHandler);
- Assert.assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
+ assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
Attachment responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(0);
byte[] attachmentBytes = readInputStream(responseAttachment.getSourceStream());
- Assert.assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
- Assert.assertEquals("text/xml", responseAttachment.getMimeType());
+ assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
+ assertEquals("text/xml", responseAttachment.getMimeType());
Map<String, String> attHeaders = responseAttachment.getHeaders();
- Assert.assertEquals(6, attHeaders.size());
+ assertEquals(6, attHeaders.size());
}
@Test
@@ -449,30 +453,30 @@ public class AttachmentTest extends Asse
}
NodeList references = doc.getElementsByTagNameNS(WSConstants.ENC_NS, "DataReference");
- Assert.assertEquals(2, references.getLength());
+ assertEquals(2, references.getLength());
NodeList cipherReferences = doc.getElementsByTagNameNS(WSConstants.ENC_NS, "CipherReference");
- Assert.assertEquals(1, cipherReferences.getLength());
+ assertEquals(1, cipherReferences.getLength());
NodeList encDatas = doc.getElementsByTagNameNS(WSConstants.ENC_NS, "EncryptedData");
- Assert.assertEquals(2, encDatas.getLength());
+ assertEquals(2, encDatas.getLength());
NodeList securityHeaderElement = doc.getElementsByTagNameNS(WSConstants.WSSE_NS, "Security");
- Assert.assertEquals(1, securityHeaderElement.getLength());
+ assertEquals(1, securityHeaderElement.getLength());
NodeList childs = securityHeaderElement.item(0).getChildNodes();
- Assert.assertEquals(2, childs.getLength());
- Assert.assertEquals(childs.item(0).getLocalName(), "EncryptedKey");
- Assert.assertEquals(childs.item(1).getLocalName(), "EncryptedData");
+ assertEquals(2, childs.getLength());
+ assertEquals(childs.item(0).getLocalName(), "EncryptedKey");
+ assertEquals(childs.item(1).getLocalName(), "EncryptedData");
attachmentCallbackHandler = new AttachmentCallbackHandler(encryptedAttachments);
verify(encryptedDoc, attachmentCallbackHandler);
- Assert.assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
+ assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
Attachment responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(0);
byte[] attachmentBytes = readInputStream(responseAttachment.getSourceStream());
- Assert.assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
- Assert.assertEquals("text/xml", responseAttachment.getMimeType());
+ assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
+ assertEquals("text/xml", responseAttachment.getMimeType());
Map<String, String> attHeaders = responseAttachment.getHeaders();
- Assert.assertEquals(6, attHeaders.size());
+ assertEquals(6, attHeaders.size());
}
@Test
@@ -515,16 +519,16 @@ public class AttachmentTest extends Asse
attachmentCallbackHandler = new AttachmentCallbackHandler(encryptedAttachments);
verify(encryptedDoc, attachmentCallbackHandler);
- Assert.assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
+ assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
Attachment responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(0);
// Different behaviour here for different JDKs...
try {
byte[] attachmentBytes = readInputStream(responseAttachment.getSourceStream());
- Assert.assertFalse(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
- Assert.assertEquals("text/xml", responseAttachment.getMimeType());
+ assertFalse(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
+ assertEquals("text/xml", responseAttachment.getMimeType());
Map<String, String> attHeaders = responseAttachment.getHeaders();
- Assert.assertEquals(6, attHeaders.size());
+ assertEquals(6, attHeaders.size());
} catch (IOException ex) { //NOPMD
// expected
}
@@ -567,32 +571,32 @@ public class AttachmentTest extends Asse
}
NodeList references = doc.getElementsByTagNameNS(WSConstants.ENC_NS, "DataReference");
- Assert.assertEquals(2, references.getLength());
+ assertEquals(2, references.getLength());
NodeList cipherReferences = doc.getElementsByTagNameNS(WSConstants.ENC_NS, "CipherReference");
- Assert.assertEquals(1, cipherReferences.getLength());
+ assertEquals(1, cipherReferences.getLength());
NodeList encDatas = doc.getElementsByTagNameNS(WSConstants.ENC_NS, "EncryptedData");
- Assert.assertEquals(2, encDatas.getLength());
+ assertEquals(2, encDatas.getLength());
NodeList securityHeaderElement = doc.getElementsByTagNameNS(WSConstants.WSSE_NS, "Security");
- Assert.assertEquals(1, securityHeaderElement.getLength());
+ assertEquals(1, securityHeaderElement.getLength());
NodeList childs = securityHeaderElement.item(0).getChildNodes();
- Assert.assertEquals(3, childs.getLength());
- Assert.assertEquals(childs.item(0).getLocalName(), "EncryptedKey");
- Assert.assertEquals(childs.item(1).getLocalName(), "ReferenceList");
- Assert.assertEquals(childs.item(2).getLocalName(), "EncryptedData");
+ assertEquals(3, childs.getLength());
+ assertEquals(childs.item(0).getLocalName(), "EncryptedKey");
+ assertEquals(childs.item(1).getLocalName(), "ReferenceList");
+ assertEquals(childs.item(2).getLocalName(), "EncryptedData");
attachmentCallbackHandler = new AttachmentCallbackHandler(encryptedAttachments);
verify(doc, attachmentCallbackHandler);
- Assert.assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
+ assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
Attachment responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(0);
byte[] attachmentBytes = readInputStream(responseAttachment.getSourceStream());
- Assert.assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
- Assert.assertEquals("text/xml", responseAttachment.getMimeType());
+ assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
+ assertEquals("text/xml", responseAttachment.getMimeType());
Map<String, String> attHeaders = responseAttachment.getHeaders();
- Assert.assertEquals(6, attHeaders.size());
+ assertEquals(6, attHeaders.size());
}
@Test
@@ -632,31 +636,31 @@ public class AttachmentTest extends Asse
}
NodeList references = doc.getElementsByTagNameNS(WSConstants.ENC_NS, "DataReference");
- Assert.assertEquals(0, references.getLength());
+ assertEquals(0, references.getLength());
NodeList cipherReferences = doc.getElementsByTagNameNS(WSConstants.ENC_NS, "CipherReference");
- Assert.assertEquals(1, cipherReferences.getLength());
+ assertEquals(1, cipherReferences.getLength());
NodeList encDatas = doc.getElementsByTagNameNS(WSConstants.ENC_NS, "EncryptedData");
- Assert.assertEquals(2, encDatas.getLength());
+ assertEquals(2, encDatas.getLength());
NodeList securityHeaderElement = doc.getElementsByTagNameNS(WSConstants.WSSE_NS, "Security");
- Assert.assertEquals(1, securityHeaderElement.getLength());
+ assertEquals(1, securityHeaderElement.getLength());
NodeList childs = securityHeaderElement.item(0).getChildNodes();
- Assert.assertEquals(2, childs.getLength());
- Assert.assertEquals(childs.item(0).getLocalName(), "EncryptedKey");
- Assert.assertEquals(childs.item(1).getLocalName(), "EncryptedData");
+ assertEquals(2, childs.getLength());
+ assertEquals(childs.item(0).getLocalName(), "EncryptedKey");
+ assertEquals(childs.item(1).getLocalName(), "EncryptedData");
attachmentCallbackHandler = new AttachmentCallbackHandler(encryptedAttachments);
verify(doc, attachmentCallbackHandler);
- Assert.assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
+ assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
Attachment responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(0);
byte[] attachmentBytes = readInputStream(responseAttachment.getSourceStream());
- Assert.assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
- Assert.assertEquals("text/xml", responseAttachment.getMimeType());
+ assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
+ assertEquals("text/xml", responseAttachment.getMimeType());
Map<String, String> attHeaders = responseAttachment.getHeaders();
- Assert.assertEquals(6, attHeaders.size());
+ assertEquals(6, attHeaders.size());
}
@Test
@@ -686,7 +690,7 @@ public class AttachmentTest extends Asse
Document encryptedDoc = encrypt.build(crypto);
- Assert.assertEquals(1, encryptedAttachments.get(0).getHeaders().size());
+ assertEquals(1, encryptedAttachments.get(0).getHeaders().size());
if (LOG.isDebugEnabled()) {
String outputString = XMLUtils.prettyDocumentToString(encryptedDoc);
@@ -696,15 +700,15 @@ public class AttachmentTest extends Asse
attachmentCallbackHandler = new AttachmentCallbackHandler(encryptedAttachments);
verify(encryptedDoc, attachmentCallbackHandler);
- Assert.assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
+ assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
Attachment responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(0);
byte[] attachmentBytes = readInputStream(responseAttachment.getSourceStream());
- Assert.assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
- Assert.assertEquals("text/xml", responseAttachment.getMimeType());
+ assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
+ assertEquals("text/xml", responseAttachment.getMimeType());
Map<String, String> attHeaders = responseAttachment.getHeaders();
- Assert.assertEquals(6, attHeaders.size());
+ assertEquals(6, attHeaders.size());
}
@Test
@@ -748,15 +752,15 @@ public class AttachmentTest extends Asse
attachmentCallbackHandler = new AttachmentCallbackHandler(encryptedAttachments);
verify(encryptedDoc, attachmentCallbackHandler);
} catch (WSSecurityException e) {
- // Assert.assertEquals(e.getMessage(), "The signature or decryption was invalid");
+ // assertEquals(e.getMessage(), "The signature or decryption was invalid");
return;
}
- Assert.assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
+ assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
Attachment responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(0);
byte[] attachmentBytes = readInputStream(responseAttachment.getSourceStream());
- Assert.assertFalse(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
- Assert.assertEquals("text/xml", responseAttachment.getMimeType());
+ assertFalse(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
+ assertEquals("text/xml", responseAttachment.getMimeType());
}
@Test
@@ -802,22 +806,22 @@ public class AttachmentTest extends Asse
attachmentCallbackHandler = new AttachmentCallbackHandler(encryptedAttachments);
verify(encryptedDoc, attachmentCallbackHandler);
- Assert.assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
+ assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
Attachment responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(0);
byte[] attachment1Bytes = readInputStream(responseAttachment.getSourceStream());
- Assert.assertTrue(Arrays.equals(attachment1Bytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
- Assert.assertEquals("text/xml", responseAttachment.getMimeType());
+ assertTrue(Arrays.equals(attachment1Bytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
+ assertEquals("text/xml", responseAttachment.getMimeType());
Map<String, String> att1Headers = responseAttachment.getHeaders();
- Assert.assertEquals(6, att1Headers.size());
+ assertEquals(6, att1Headers.size());
responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(1);
byte[] attachment2Bytes = readInputStream(responseAttachment.getSourceStream());
- Assert.assertTrue(Arrays.equals(attachment2Bytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
- Assert.assertEquals("text/plain", responseAttachment.getMimeType());
+ assertTrue(Arrays.equals(attachment2Bytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
+ assertEquals("text/plain", responseAttachment.getMimeType());
Map<String, String> att2Headers = responseAttachment.getHeaders();
- Assert.assertEquals(6, att2Headers.size());
+ assertEquals(6, att2Headers.size());
}
@Test
@@ -864,25 +868,25 @@ public class AttachmentTest extends Asse
}
NodeList securityHeaderElement = doc.getElementsByTagNameNS(WSConstants.WSSE_NS, "Security");
- Assert.assertEquals(1, securityHeaderElement.getLength());
+ assertEquals(1, securityHeaderElement.getLength());
NodeList childs = securityHeaderElement.item(0).getChildNodes();
- Assert.assertEquals(3, childs.getLength());
- Assert.assertEquals(childs.item(0).getLocalName(), "EncryptedKey");
- Assert.assertEquals(childs.item(1).getLocalName(), "EncryptedData");
- Assert.assertEquals(childs.item(2).getLocalName(), "Signature");
+ assertEquals(3, childs.getLength());
+ assertEquals(childs.item(0).getLocalName(), "EncryptedKey");
+ assertEquals(childs.item(1).getLocalName(), "EncryptedData");
+ assertEquals(childs.item(2).getLocalName(), "Signature");
attachmentCallbackHandler = new AttachmentCallbackHandler(encryptedAttachments);
verify(encryptedDoc, attachmentCallbackHandler);
- Assert.assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
+ assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
Attachment responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(1);
byte[] attachmentBytes = readInputStream(responseAttachment.getSourceStream());
- Assert.assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
- Assert.assertEquals("text/xml", responseAttachment.getMimeType());
+ assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
+ assertEquals("text/xml", responseAttachment.getMimeType());
Map<String, String> attHeaders = responseAttachment.getHeaders();
- Assert.assertEquals(6, attHeaders.size());
+ assertEquals(6, attHeaders.size());
}
@Test
@@ -978,9 +982,9 @@ public class AttachmentTest extends Asse
}
}
});
- Assert.fail();
+ fail();
} catch (WSSecurityException e) {
- Assert.assertEquals(e.getMessage(), "The signature or decryption was invalid");
+ assertEquals(e.getMessage(), "The signature or decryption was invalid");
}
}
@@ -1028,25 +1032,25 @@ public class AttachmentTest extends Asse
}
NodeList securityHeaderElement = doc.getElementsByTagNameNS(WSConstants.WSSE_NS, "Security");
- Assert.assertEquals(1, securityHeaderElement.getLength());
+ assertEquals(1, securityHeaderElement.getLength());
NodeList childs = securityHeaderElement.item(0).getChildNodes();
- Assert.assertEquals(3, childs.getLength());
- Assert.assertEquals(childs.item(0).getLocalName(), "Signature");
- Assert.assertEquals(childs.item(1).getLocalName(), "EncryptedKey");
- Assert.assertEquals(childs.item(2).getLocalName(), "EncryptedData");
+ assertEquals(3, childs.getLength());
+ assertEquals(childs.item(0).getLocalName(), "Signature");
+ assertEquals(childs.item(1).getLocalName(), "EncryptedKey");
+ assertEquals(childs.item(2).getLocalName(), "EncryptedData");
attachmentCallbackHandler = new AttachmentCallbackHandler(encryptedAttachments);
verify(doc, attachmentCallbackHandler);
- Assert.assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
+ assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
Attachment responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(1);
byte[] attachmentBytes = readInputStream(responseAttachment.getSourceStream());
- Assert.assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
- Assert.assertEquals("text/xml", responseAttachment.getMimeType());
+ assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
+ assertEquals("text/xml", responseAttachment.getMimeType());
Map<String, String> attHeaders = responseAttachment.getHeaders();
- Assert.assertEquals(6, attHeaders.size());
+ assertEquals(6, attHeaders.size());
}
@Test
@@ -1140,9 +1144,9 @@ public class AttachmentTest extends Asse
}
}
});
- Assert.fail();
+ fail();
} catch (WSSecurityException e) {
- Assert.assertEquals(e.getMessage(), "The signature or decryption was invalid");
+ assertEquals(e.getMessage(), "The signature or decryption was invalid");
}
}
@@ -1160,4 +1164,4 @@ public class AttachmentTest extends Asse
requestData.setCallbackHandler(new KeystoreCallbackHandler());
return secEngine.processSecurityHeader(doc, requestData);
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/CertErrorTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/CertErrorTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/CertErrorTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/CertErrorTest.java Thu Jan 3 11:48:56 2019
@@ -27,12 +27,15 @@ import org.apache.wss4j.common.crypto.Cr
import org.apache.wss4j.common.ext.WSSecurityException;
import org.w3c.dom.Document;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* This class tests for error messages that apply to certificates, e.g. when a bad
* "username" is used for encryption or signature. See WSS-137.
*/
-public class CertErrorTest extends org.junit.Assert {
+public class CertErrorTest {
@org.junit.AfterClass
public static void cleanup() throws Exception {
@@ -83,4 +86,4 @@ public class CertErrorTest extends org.j
}
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyActionTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyActionTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyActionTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyActionTest.java Thu Jan 3 11:48:56 2019
@@ -44,13 +44,14 @@ import org.apache.wss4j.dom.handler.Hand
import org.apache.wss4j.dom.handler.RequestData;
import org.apache.wss4j.dom.handler.WSHandlerConstants;
import org.apache.wss4j.dom.handler.WSHandlerResult;
-import org.junit.Assert;
import org.junit.Test;
+import static org.junit.Assert.assertTrue;
+
/**
* A set of tests for using a derived key for encryption/signature using WSHandler actions.
*/
-public class DerivedKeyActionTest extends Assert {
+public class DerivedKeyActionTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(DerivedKeyActionTest.class);
private CallbackHandler callbackHandler = new KeystoreCallbackHandler();
@@ -90,7 +91,7 @@ public class DerivedKeyActionTest extend
);
String outputString =
XMLUtils.prettyDocumentToString(doc);
- Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
+ assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
if (LOG.isDebugEnabled()) {
LOG.debug(outputString);
}
@@ -123,7 +124,7 @@ public class DerivedKeyActionTest extend
);
String outputString =
XMLUtils.prettyDocumentToString(doc);
- Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_02));
+ assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_02));
if (LOG.isDebugEnabled()) {
LOG.debug(outputString);
}
@@ -188,7 +189,7 @@ public class DerivedKeyActionTest extend
);
String outputString =
XMLUtils.prettyDocumentToString(doc);
- Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
+ assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
if (LOG.isDebugEnabled()) {
LOG.debug(outputString);
}
@@ -353,7 +354,7 @@ public class DerivedKeyActionTest extend
);
String outputString =
XMLUtils.prettyDocumentToString(doc);
- Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
+ assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
if (LOG.isDebugEnabled()) {
LOG.debug(outputString);
}
@@ -393,7 +394,7 @@ public class DerivedKeyActionTest extend
);
String outputString =
XMLUtils.prettyDocumentToString(doc);
- Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
+ assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
if (LOG.isDebugEnabled()) {
LOG.debug(outputString);
}
@@ -429,7 +430,7 @@ public class DerivedKeyActionTest extend
);
String outputString =
XMLUtils.prettyDocumentToString(doc);
- Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
+ assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
if (LOG.isDebugEnabled()) {
LOG.debug(outputString);
}
@@ -465,7 +466,7 @@ public class DerivedKeyActionTest extend
);
String outputString =
XMLUtils.prettyDocumentToString(doc);
- Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
+ assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
if (LOG.isDebugEnabled()) {
LOG.debug(outputString);
}
@@ -507,7 +508,7 @@ public class DerivedKeyActionTest extend
);
String outputString =
XMLUtils.prettyDocumentToString(doc);
- Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
+ assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
if (LOG.isDebugEnabled()) {
LOG.debug(outputString);
}
@@ -549,7 +550,7 @@ public class DerivedKeyActionTest extend
);
String outputString =
XMLUtils.prettyDocumentToString(doc);
- Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
+ assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
if (LOG.isDebugEnabled()) {
LOG.debug(outputString);
}
@@ -572,4 +573,4 @@ public class DerivedKeyActionTest extend
return results;
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyTest.java Thu Jan 3 11:48:56 2019
@@ -39,10 +39,14 @@ import java.security.cert.X509Certificat
import javax.security.auth.callback.CallbackHandler;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
/**
* A set of tests for using a derived key for encryption/signature.
*/
-public class DerivedKeyTest extends org.junit.Assert {
+public class DerivedKeyTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(DerivedKeyTest.class);
private WSSecurityEngine secEngine = new WSSecurityEngine();
@@ -359,4 +363,4 @@ public class DerivedKeyTest extends org.
return results;
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptedDataInHeaderTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptedDataInHeaderTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptedDataInHeaderTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptedDataInHeaderTest.java Thu Jan 3 11:48:56 2019
@@ -38,13 +38,16 @@ import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+
/**
* This test encrypts a Timestamp and the SOAP Body, and appends the ReferenceList Element after the
* EncryptedData Element that is the Timestamp. When processing, the EncryptedData Element gets decrypted,
* and then the ReferenceListProcessor must check to see whether the Data Reference pointing to the
* encrypted Timestamp needs to be decrypted or not.
*/
-public class EncryptedDataInHeaderTest extends org.junit.Assert {
+public class EncryptedDataInHeaderTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(EncryptedDataInHeaderTest.class);
@@ -128,4 +131,4 @@ public class EncryptedDataInHeaderTest e
return results;
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionAlgorithmSuiteTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionAlgorithmSuiteTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionAlgorithmSuiteTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionAlgorithmSuiteTest.java Thu Jan 3 11:48:56 2019
@@ -42,11 +42,14 @@ import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* A set of test-cases for encrypting and decrypting SOAP requests when specifying an
* AlgorithmSuite policy.
*/
-public class EncryptionAlgorithmSuiteTest extends org.junit.Assert {
+public class EncryptionAlgorithmSuiteTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(EncryptionAlgorithmSuiteTest.class);
@@ -297,4 +300,4 @@ public class EncryptionAlgorithmSuiteTes
return secEngine.processSecurityHeader(securityHeader, data);
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionCRLTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionCRLTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionCRLTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionCRLTest.java Thu Jan 3 11:48:56 2019
@@ -42,13 +42,16 @@ import org.apache.wss4j.dom.handler.WSHa
import org.junit.Before;
import org.junit.Test;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* This is a test for Certificate Revocation List checking before encryption.
*
* This test reuses the revoked certificate from SignatureCRLTest
*/
-public class EncryptionCRLTest extends org.junit.Assert {
+public class EncryptionCRLTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(EncryptionCRLTest.class);
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionGCMTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionGCMTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionGCMTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionGCMTest.java Thu Jan 3 11:48:56 2019
@@ -43,11 +43,16 @@ import org.w3c.dom.Document;
import java.util.ArrayList;
import java.util.List;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
/**
* A set of test-cases for encrypting and decrypting SOAP requests using GCM. See:
* https://issues.apache.org/jira/browse/WSS-325
*/
-public class EncryptionGCMTest extends org.junit.Assert {
+public class EncryptionGCMTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(EncryptionGCMTest.class);
private static final javax.xml.namespace.QName SOAP_BODY =
@@ -215,4 +220,4 @@ public class EncryptionGCMTest extends o
assertTrue(encrypted);
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java Thu Jan 3 11:48:56 2019
@@ -44,11 +44,17 @@ import javax.xml.namespace.QName;
import java.util.List;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* This is some unit tests for encryption using encryption using parts. Note that the "soapMsg" below
* has a custom header added.
*/
-public class EncryptionPartsTest extends org.junit.Assert {
+public class EncryptionPartsTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(EncryptionPartsTest.class);
private static final String SOAPMSG = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
@@ -579,4 +585,4 @@ public class EncryptionPartsTest extends
return results;
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionTest.java Thu Jan 3 11:48:56 2019
@@ -58,10 +58,16 @@ import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* A set of test-cases for encrypting and decrypting SOAP requests.
*/
-public class EncryptionTest extends org.junit.Assert {
+public class EncryptionTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(EncryptionTest.class);
private static final javax.xml.namespace.QName SOAP_BODY =
@@ -821,4 +827,4 @@ public class EncryptionTest extends org.
return results;
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/ModifiedRequestTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/ModifiedRequestTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/ModifiedRequestTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/ModifiedRequestTest.java Thu Jan 3 11:48:56 2019
@@ -52,10 +52,13 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* This class tests the modification of requests.
*/
-public class ModifiedRequestTest extends org.junit.Assert {
+public class ModifiedRequestTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(ModifiedRequestTest.class);
private static final String SOAPMSG =
@@ -636,4 +639,4 @@ public class ModifiedRequestTest extends
return secEngine.processSecurityHeader(doc, null, callbackHandler, crypto);
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/NoSoapPrefixSignatureTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/NoSoapPrefixSignatureTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/NoSoapPrefixSignatureTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/NoSoapPrefixSignatureTest.java Thu Jan 3 11:48:56 2019
@@ -34,7 +34,7 @@ import org.w3c.dom.Document;
* This is a test for WSS-60 - "Problems when SOAP envelope namespace prefix is null"
* http://issues.apache.org/jira/browse/WSS-60
*/
-public class NoSoapPrefixSignatureTest extends org.junit.Assert {
+public class NoSoapPrefixSignatureTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(NoSoapPrefixSignatureTest.class);
private WSSecurityEngine secEngine = new WSSecurityEngine();
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/PasswordEncryptorTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/PasswordEncryptorTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/PasswordEncryptorTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/PasswordEncryptorTest.java Thu Jan 3 11:48:56 2019
@@ -44,12 +44,14 @@ import org.apache.wss4j.dom.handler.WSHa
import org.junit.Test;
import org.w3c.dom.Document;
+import static org.junit.Assert.assertNotNull;
+
/**
* This is a test for signing and encrypting using a Crypto properties file with an encrypted
* password
*/
-public class PasswordEncryptorTest extends org.junit.Assert {
+public class PasswordEncryptorTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(PasswordEncryptorTest.class);
@@ -195,4 +197,4 @@ public class PasswordEncryptorTest exten
return secEngine.processSecurityHeader(doc, null, callbackHandler, crypto);
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/PasswordTypeTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/PasswordTypeTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/PasswordTypeTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/PasswordTypeTest.java Thu Jan 3 11:48:56 2019
@@ -37,11 +37,14 @@ import org.w3c.dom.Document;
import javax.security.auth.callback.CallbackHandler;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* This is a test for processing a Username Token to enforce either a plaintext or digest
* password type. See WSS-255.
*/
-public class PasswordTypeTest extends org.junit.Assert {
+public class PasswordTypeTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(PasswordTypeTest.class);
private CallbackHandler callbackHandler = new UsernamePasswordCallbackHandler();
@@ -204,4 +207,4 @@ public class PasswordTypeTest extends or
}
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/ReplayTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/ReplayTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/ReplayTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/ReplayTest.java Thu Jan 3 11:48:56 2019
@@ -51,10 +51,13 @@ import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* Some test-cases for replay attacks.
*/
-public class ReplayTest extends org.junit.Assert {
+public class ReplayTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(ReplayTest.class);
@@ -584,4 +587,4 @@ public class ReplayTest extends org.juni
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/RequireSignedEncryptedDataElementsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/RequireSignedEncryptedDataElementsTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/RequireSignedEncryptedDataElementsTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/RequireSignedEncryptedDataElementsTest.java Thu Jan 3 11:48:56 2019
@@ -44,12 +44,16 @@ import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* Tests for the WSHandlerConstants.REQUIRE_SIGNED_ENCRYPTED_DATA_ELEMENTS option.
* This test verifies some wrapping techniques are properly handled when the afore
* mentioned option is on.
*/
-public class RequireSignedEncryptedDataElementsTest extends org.junit.Assert {
+public class RequireSignedEncryptedDataElementsTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(RequireSignedEncryptedDataElementsTest.class);
private static ResourceBundle resources = ResourceBundle.getBundle("messages.wss4j_errors");
@@ -363,4 +367,4 @@ public class RequireSignedEncryptedDataE
return resultList;
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SKISignatureTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SKISignatureTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SKISignatureTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SKISignatureTest.java Thu Jan 3 11:48:56 2019
@@ -33,10 +33,13 @@ import org.apache.wss4j.dom.str.STRParse
import org.junit.Test;
import org.w3c.dom.Document;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
/**
* WS-Security Test Case for SubjectKeyIdentifier.
*/
-public class SKISignatureTest extends org.junit.Assert {
+public class SKISignatureTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(SKISignatureTest.class);
private WSSecurityEngine secEngine = new WSSecurityEngine();
@@ -172,4 +175,4 @@ public class SKISignatureTest extends or
private WSHandlerResult verify(Document doc) throws Exception {
return secEngine.processSecurityHeader(doc, null, null, crypto);
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/STRSignatureTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/STRSignatureTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/STRSignatureTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/STRSignatureTest.java Thu Jan 3 11:48:56 2019
@@ -37,7 +37,7 @@ import org.w3c.dom.Document;
* WS-Security Test Case for signature creation/validation using the
* SecurityTokenReference transform.
*/
-public class STRSignatureTest extends org.junit.Assert {
+public class STRSignatureTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(STRSignatureTest.class);
private WSSecurityEngine secEngine = new WSSecurityEngine();
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SecurityContextTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SecurityContextTokenTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SecurityContextTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SecurityContextTokenTest.java Thu Jan 3 11:48:56 2019
@@ -37,10 +37,14 @@ import org.apache.wss4j.dom.util.WSSecur
import org.junit.Test;
import org.w3c.dom.Document;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* A set of tests for SecurityContextTokens.
*/
-public class SecurityContextTokenTest extends org.junit.Assert {
+public class SecurityContextTokenTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(SecurityContextTokenTest.class);
private WSSecurityEngine secEngine = new WSSecurityEngine();
@@ -380,4 +384,4 @@ public class SecurityContextTokenTest ex
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureAKITest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureAKITest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureAKITest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureAKITest.java Thu Jan 3 11:48:56 2019
@@ -38,11 +38,13 @@ import org.apache.wss4j.dom.handler.WSHa
import org.junit.Test;
import org.w3c.dom.Document;
+import static org.junit.Assert.assertNotNull;
+
/**
* A set of test-cases for signing and verifying SOAP requests using the Merlin AKI Crypto implementation.
*/
-public class SignatureAKITest extends org.junit.Assert {
+public class SignatureAKITest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(SignatureAKITest.class);
@@ -128,4 +130,4 @@ public class SignatureAKITest extends or
return secEngine.processSecurityHeader(doc, null, null, crypto);
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureAlgorithmSuiteTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureAlgorithmSuiteTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureAlgorithmSuiteTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureAlgorithmSuiteTest.java Thu Jan 3 11:48:56 2019
@@ -47,11 +47,14 @@ import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* A set of test-cases for signing and verifying SOAP requests when specifying an
* AlgorithmSuite policy.
*/
-public class SignatureAlgorithmSuiteTest extends org.junit.Assert {
+public class SignatureAlgorithmSuiteTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(SignatureAlgorithmSuiteTest.class);
@@ -300,4 +303,4 @@ public class SignatureAlgorithmSuiteTest
return secEngine.processSecurityHeader(securityHeader, data);
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCRLTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCRLTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCRLTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCRLTest.java Thu Jan 3 11:48:56 2019
@@ -38,6 +38,10 @@ import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* This is a test for Certificate Revocation List checking. A message is signed and sent to the
* receiver. If Certificate Revocation is enabled, then signature trust verification should
@@ -64,7 +68,7 @@ import org.w3c.dom.Element;
* openssl ca -gencrl -keyfile wss40CAKey.pem -cert wss40CA.pem -out wss40CACRL.pem
* -config ca.config -crldays 3650
*/
-public class SignatureCRLTest extends org.junit.Assert {
+public class SignatureCRLTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(SignatureCRLTest.class);
private Crypto crypto;
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCertConstraintsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCertConstraintsTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCertConstraintsTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCertConstraintsTest.java Thu Jan 3 11:48:56 2019
@@ -38,12 +38,15 @@ import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* A set of test-cases for signing and verifying SOAP requests, where the certificate used to
* verify the signature is validated against a set of cert constraints.
*/
-public class SignatureCertConstraintsTest extends org.junit.Assert {
+public class SignatureCertConstraintsTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(SignatureCertConstraintsTest.class);
private Crypto crypto;
@@ -146,4 +149,4 @@ public class SignatureCertConstraintsTes
return secEngine.processSecurityHeader(securityHeader, data);
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCertTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCertTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCertTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCertTest.java Thu Jan 3 11:48:56 2019
@@ -42,6 +42,10 @@ import java.security.cert.X509Certificat
import java.util.Collections;
import java.util.Properties;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* This is a test for WSS-40. Essentially it just tests that a message is signed using a
* keyEntry from one keystore, and verified at the other end with a keystore with just the
@@ -70,7 +74,7 @@ import java.util.Properties;
* keytool -import -file wss40.crt -alias wss40 -keystore wss40.jks
*
*/
-public class SignatureCertTest extends org.junit.Assert {
+public class SignatureCertTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(SignatureCertTest.class);
private WSSecurityEngine secEngine = new WSSecurityEngine();
@@ -404,4 +408,4 @@ public class SignatureCertTest extends o
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureEncryptionTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureEncryptionTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureEncryptionTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureEncryptionTest.java Thu Jan 3 11:48:56 2019
@@ -45,10 +45,15 @@ import javax.xml.crypto.dsig.SignatureMe
import java.util.List;
import java.util.ArrayList;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
/**
* A set of tests for combined signature/encryption, verification/decryption.
*/
-public class SignatureEncryptionTest extends org.junit.Assert {
+public class SignatureEncryptionTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(SignatureEncryptionTest.class);
private static final String SOAPMSG =
@@ -498,4 +503,4 @@ public class SignatureEncryptionTest ext
return resultList;
}
-}
+}
\ No newline at end of file
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureIssuerCertConstraintsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureIssuerCertConstraintsTest.java?rev=1850227&r1=1850226&r2=1850227&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureIssuerCertConstraintsTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureIssuerCertConstraintsTest.java Thu Jan 3 11:48:56 2019
@@ -38,12 +38,15 @@ import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* A set of test-cases for signing and verifying SOAP requests, where the issuer of the certificate used to
* verify the signature is validated against a set of cert constraints.
*/
-public class SignatureIssuerCertConstraintsTest extends org.junit.Assert {
+public class SignatureIssuerCertConstraintsTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(SignatureIssuerCertConstraintsTest.class);
private Crypto crypto;
@@ -146,4 +149,4 @@ public class SignatureIssuerCertConstrai
return secEngine.processSecurityHeader(securityHeader, data);
}
-}
+}
\ No newline at end of file