This is an automated email from the ASF dual-hosted git repository. coheigea pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 6228a705ec8e101667a786ecd039dd309f6ab474 Author: Colm O hEigeartaigh <[email protected]> AuthorDate: Wed Dec 26 11:34:39 2018 +0000 Stop extending Assert in sts-core --- .../java/org/apache/cxf/sts/cache/EhCacheIdentityCacheTest.java | 5 ++++- .../java/org/apache/cxf/sts/cache/HazelCastTokenStoreTest.java | 6 +++++- .../java/org/apache/cxf/sts/cache/MemoryIdentityCacheTest.java | 5 ++++- .../org/apache/cxf/sts/claims/mapper/JexlClaimsMapperTest.java | 7 ++++++- .../apache/cxf/sts/claims/mapper/JexlIssueSamlClaimsTest.java | 7 ++++++- .../java/org/apache/cxf/sts/operation/CancelSCTUnitTest.java | 5 ++++- .../org/apache/cxf/sts/operation/IssueEncryptedUnitTest.java | 5 ++++- .../org/apache/cxf/sts/operation/IssueJWTClaimsUnitTest.java | 6 +++++- .../org/apache/cxf/sts/operation/IssueJWTOnbehalfofUnitTest.java | 6 +++++- .../java/org/apache/cxf/sts/operation/IssueJWTRealmUnitTest.java | 6 +++++- .../test/java/org/apache/cxf/sts/operation/IssueJWTUnitTest.java | 5 ++++- .../org/apache/cxf/sts/operation/IssueOnbehalfofUnitTest.java | 7 ++++++- .../test/java/org/apache/cxf/sts/operation/IssueSCTUnitTest.java | 6 +++++- .../org/apache/cxf/sts/operation/IssueSamlClaimsUnitTest.java | 7 ++++++- .../org/apache/cxf/sts/operation/IssueSamlRealmUnitTest.java | 7 ++++++- .../java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java | 8 +++++++- .../test/java/org/apache/cxf/sts/operation/IssueUnitTest.java | 6 +++++- .../java/org/apache/cxf/sts/operation/RenewSamlUnitTest.java | 5 ++++- .../apache/cxf/sts/operation/ValidateJWTTransformationTest.java | 5 ++++- .../java/org/apache/cxf/sts/operation/ValidateJWTUnitTest.java | 5 ++++- .../java/org/apache/cxf/sts/operation/ValidateSCTUnitTest.java | 7 ++++++- .../java/org/apache/cxf/sts/operation/ValidateSamlUnitTest.java | 5 ++++- .../cxf/sts/operation/ValidateTokenTransformationUnitTest.java | 5 ++++- .../test/java/org/apache/cxf/sts/operation/ValidateUnitTest.java | 6 +++++- .../apache/cxf/sts/operation/ValidateUsernameTokenUnitTest.java | 5 ++++- .../org/apache/cxf/sts/operation/ValidateX509TokenUnitTest.java | 5 ++++- .../java/org/apache/cxf/sts/request/RequestParserUnitTest.java | 5 ++++- .../org/apache/cxf/sts/token/canceller/SCTCancellerTest.java | 6 +++++- .../java/org/apache/cxf/sts/token/provider/JWTClaimsTest.java | 6 +++++- .../org/apache/cxf/sts/token/provider/JWTProviderActAsTest.java | 5 ++++- .../apache/cxf/sts/token/provider/JWTProviderLifetimeTest.java | 6 +++++- .../apache/cxf/sts/token/provider/JWTProviderOnBehalfOfTest.java | 5 ++++- .../apache/cxf/sts/token/provider/JWTTokenProviderRealmTest.java | 6 +++++- .../org/apache/cxf/sts/token/provider/JWTTokenProviderTest.java | 6 +++++- .../java/org/apache/cxf/sts/token/provider/SAMLClaimsTest.java | 8 +++++++- .../org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java | 6 +++++- .../apache/cxf/sts/token/provider/SAMLProviderCustomTest.java | 6 +++++- .../apache/cxf/sts/token/provider/SAMLProviderKeyTypeTest.java | 8 +++++++- .../apache/cxf/sts/token/provider/SAMLProviderLifetimeTest.java | 7 +++++-- .../cxf/sts/token/provider/SAMLProviderOnBehalfOfTest.java | 6 +++++- .../org/apache/cxf/sts/token/provider/SAMLProviderRealmTest.java | 6 +++++- .../java/org/apache/cxf/sts/token/provider/SCTProviderTest.java | 7 ++++++- .../java/org/apache/cxf/sts/token/realm/RealmSupportTest.java | 2 +- .../cxf/sts/token/renewer/SAMLTokenRenewerLifetimeTest.java | 6 +++++- .../apache/cxf/sts/token/renewer/SAMLTokenRenewerPOPTest.java | 6 +++++- .../apache/cxf/sts/token/renewer/SAMLTokenRenewerRealmTest.java | 5 ++++- .../org/apache/cxf/sts/token/renewer/SAMLTokenRenewerTest.java | 7 ++++++- .../cxf/sts/token/validator/JWTTokenValidatorRealmTest.java | 6 +++++- .../apache/cxf/sts/token/validator/JWTTokenValidatorTest.java | 5 ++++- .../sts/token/validator/SAMLTokenValidatorCachedRealmTest.java | 5 ++++- .../cxf/sts/token/validator/SAMLTokenValidatorRealmTest.java | 6 +++++- .../apache/cxf/sts/token/validator/SAMLTokenValidatorTest.java | 5 ++++- .../org/apache/cxf/sts/token/validator/SCTValidatorTest.java | 5 ++++- .../cxf/sts/token/validator/UsernameTokenValidatorTest.java | 4 +++- .../apache/cxf/sts/token/validator/X509TokenValidatorTest.java | 5 ++++- .../wsn-core/src/test/java/org/apache/cxf/wsn/WsnBrokerTest.java | 9 +++++---- testutils/src/main/java/org/apache/cxf/test/AbstractCXFTest.java | 3 +-- .../java/org/apache/cxf/testutil/recorders/MessageRecorder.java | 4 ++-- testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java | 5 +++-- .../apache/cxf/testutils/header_test/rpc/TestRPCHeaderTest.java | 5 +++-- 60 files changed, 276 insertions(+), 68 deletions(-) diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/cache/EhCacheIdentityCacheTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/cache/EhCacheIdentityCacheTest.java index fa9bd4d..4ef4071 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/cache/EhCacheIdentityCacheTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/cache/EhCacheIdentityCacheTest.java @@ -26,7 +26,10 @@ import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.junit.BeforeClass; -public class EhCacheIdentityCacheTest extends org.junit.Assert { +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public class EhCacheIdentityCacheTest { @BeforeClass public static void init() throws Exception { diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/cache/HazelCastTokenStoreTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/cache/HazelCastTokenStoreTest.java index 687f9fc..5914faf 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/cache/HazelCastTokenStoreTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/cache/HazelCastTokenStoreTest.java @@ -26,7 +26,11 @@ import org.apache.cxf.ws.security.tokenstore.TokenStore; import org.junit.BeforeClass; -public class HazelCastTokenStoreTest extends org.junit.Assert { +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +public class HazelCastTokenStoreTest { private static TokenStore store; diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/cache/MemoryIdentityCacheTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/cache/MemoryIdentityCacheTest.java index cd5eec3..ddbde7c 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/cache/MemoryIdentityCacheTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/cache/MemoryIdentityCacheTest.java @@ -24,7 +24,10 @@ import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.junit.BeforeClass; -public class MemoryIdentityCacheTest extends org.junit.Assert { +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public class MemoryIdentityCacheTest { @BeforeClass public static void init() throws Exception { diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/claims/mapper/JexlClaimsMapperTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/claims/mapper/JexlClaimsMapperTest.java index 6ee7eeb..4f6ffa3 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/claims/mapper/JexlClaimsMapperTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/claims/mapper/JexlClaimsMapperTest.java @@ -35,8 +35,13 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + @RunWith(Parameterized.class) -public class JexlClaimsMapperTest extends org.junit.Assert { +public class JexlClaimsMapperTest { JexlClaimsMapper jcm; diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/claims/mapper/JexlIssueSamlClaimsTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/claims/mapper/JexlIssueSamlClaimsTest.java index 522c7fb..b40f5ed 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/claims/mapper/JexlIssueSamlClaimsTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/claims/mapper/JexlIssueSamlClaimsTest.java @@ -83,10 +83,15 @@ import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.apache.wss4j.common.saml.builder.SAML2Constants; import org.apache.wss4j.common.util.DOM2Writer; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * Some unit tests for the issue operation to issue SAML tokens with Claims information. */ -public class JexlIssueSamlClaimsTest extends org.junit.Assert { +public class JexlIssueSamlClaimsTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY .createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/CancelSCTUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/CancelSCTUnitTest.java index a8e0133..f7be7ec 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/CancelSCTUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/CancelSCTUnitTest.java @@ -56,10 +56,13 @@ import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for the cancel operation to cancel SecurityContextTokens. */ -public class CancelSCTUnitTest extends org.junit.Assert { +public class CancelSCTUnitTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueEncryptedUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueEncryptedUnitTest.java index a2ed021..02b5432 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueEncryptedUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueEncryptedUnitTest.java @@ -49,10 +49,13 @@ import org.apache.wss4j.common.crypto.Crypto; import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.dom.WSConstants; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * Some unit tests for issuing encrypted tokens. */ -public class IssueEncryptedUnitTest extends org.junit.Assert { +public class IssueEncryptedUnitTest { private static boolean unrestrictedPoliciesInstalled; diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTClaimsUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTClaimsUnitTest.java index 49a1383..b0cd472 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTClaimsUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTClaimsUnitTest.java @@ -89,10 +89,14 @@ import org.apache.wss4j.common.util.DOM2Writer; import org.junit.Assert; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for the issue operation to issue JWT tokens with Claims information. */ -public class IssueJWTClaimsUnitTest extends org.junit.Assert { +public class IssueJWTClaimsUnitTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTOnbehalfofUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTOnbehalfofUnitTest.java index 31746dc..424ece9 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTOnbehalfofUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTOnbehalfofUnitTest.java @@ -80,10 +80,14 @@ import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.junit.Assert; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * Issue JWT tokens on behalf of other tokens. */ -public class IssueJWTOnbehalfofUnitTest extends org.junit.Assert { +public class IssueJWTOnbehalfofUnitTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTRealmUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTRealmUnitTest.java index e46aac7..6696460 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTRealmUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTRealmUnitTest.java @@ -64,10 +64,14 @@ import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.junit.Assert; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * Some unit tests for the issue operation to issue JWT tokens in a specific realm. */ -public class IssueJWTRealmUnitTest extends org.junit.Assert { +public class IssueJWTRealmUnitTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTUnitTest.java index 87fda2d..3d5795e 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTUnitTest.java @@ -62,10 +62,13 @@ import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.junit.Assert; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for the issue operation to issue JWT Tokens. */ -public class IssueJWTUnitTest extends org.junit.Assert { +public class IssueJWTUnitTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueOnbehalfofUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueOnbehalfofUnitTest.java index b1e6efb..81967b6 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueOnbehalfofUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueOnbehalfofUnitTest.java @@ -88,10 +88,15 @@ import org.apache.wss4j.common.saml.SamlAssertionWrapper; import org.apache.wss4j.common.saml.builder.SAML2Constants; import org.apache.wss4j.common.util.DOM2Writer; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * Some unit tests for the issue operation. */ -public class IssueOnbehalfofUnitTest extends org.junit.Assert { +public class IssueOnbehalfofUnitTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSCTUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSCTUnitTest.java index 893ae73..317fbcb 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSCTUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSCTUnitTest.java @@ -58,10 +58,14 @@ import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.apache.wss4j.common.util.DOM2Writer; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for the issue operation to issue SecurityContextTokens. */ -public class IssueSCTUnitTest extends org.junit.Assert { +public class IssueSCTUnitTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlClaimsUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlClaimsUnitTest.java index e804f73..e166a1d 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlClaimsUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlClaimsUnitTest.java @@ -87,10 +87,15 @@ import org.apache.wss4j.common.saml.builder.SAML1Constants; import org.apache.wss4j.common.saml.builder.SAML2Constants; import org.apache.wss4j.common.util.DOM2Writer; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + + /** * Some unit tests for the issue operation to issue SAML tokens with Claims information. */ -public class IssueSamlClaimsUnitTest extends org.junit.Assert { +public class IssueSamlClaimsUnitTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlRealmUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlRealmUnitTest.java index 1a06497..282ef2d 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlRealmUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlRealmUnitTest.java @@ -58,10 +58,15 @@ import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.apache.wss4j.common.util.DOM2Writer; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * Some unit tests for the issue operation to issue SAML tokens in a specific realm. */ -public class IssueSamlRealmUnitTest extends org.junit.Assert { +public class IssueSamlRealmUnitTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java index 4958258..432b36d 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java @@ -79,10 +79,16 @@ import org.apache.wss4j.dom.message.WSSecEncryptedKey; import org.apache.wss4j.dom.saml.WSSSAMLKeyInfoProcessor; import org.apache.wss4j.dom.util.WSSecurityUtil; +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; + /** * Some unit tests for the issue operation to issue SAML tokens. */ -public class IssueSamlUnitTest extends org.junit.Assert { +public class IssueSamlUnitTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueUnitTest.java index 15141ff..42af1c5 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueUnitTest.java @@ -49,10 +49,14 @@ import org.apache.cxf.ws.security.sts.provider.model.utility.AttributedDateTime; import org.apache.wss4j.common.WSS4JConstants; import org.apache.wss4j.common.util.DateUtil; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * Some unit tests for the issue operation. */ -public class IssueUnitTest extends org.junit.Assert { +public class IssueUnitTest { /** * Test to successfully issue a (dummy) token. diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/RenewSamlUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/RenewSamlUnitTest.java index 5fa925d..7cfb6e1 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/RenewSamlUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/RenewSamlUnitTest.java @@ -71,10 +71,13 @@ import org.apache.wss4j.common.util.DateUtil; import org.junit.BeforeClass; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for the renew operation to renew SAML tokens. */ -public class RenewSamlUnitTest extends org.junit.Assert { +public class RenewSamlUnitTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateJWTTransformationTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateJWTTransformationTest.java index 6651c39..9159f0c 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateJWTTransformationTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateJWTTransformationTest.java @@ -82,10 +82,13 @@ import org.apache.wss4j.common.util.DOM2Writer; import org.junit.Assert; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * This tests validating a JWT Token + transforming into a SAML token, and vice versa. */ -public class ValidateJWTTransformationTest extends org.junit.Assert { +public class ValidateJWTTransformationTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateJWTUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateJWTUnitTest.java index c8116e5..28bf8e2 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateJWTUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateJWTUnitTest.java @@ -56,10 +56,13 @@ import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for the validate operation to validate JWT Tokens. */ -public class ValidateJWTUnitTest extends org.junit.Assert { +public class ValidateJWTUnitTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateSCTUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateSCTUnitTest.java index b8ceed6..8792d24 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateSCTUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateSCTUnitTest.java @@ -57,10 +57,15 @@ import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for the validate operation to validate SecurityContextTokens. */ -public class ValidateSCTUnitTest extends org.junit.Assert { +public class ValidateSCTUnitTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateSamlUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateSamlUnitTest.java index d4638b4..5f5ed10 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateSamlUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateSamlUnitTest.java @@ -57,10 +57,13 @@ import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for the validate operation to validate SAML tokens. */ -public class ValidateSamlUnitTest extends org.junit.Assert { +public class ValidateSamlUnitTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateTokenTransformationUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateTokenTransformationUnitTest.java index c375fe7..660c835 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateTokenTransformationUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateTokenTransformationUnitTest.java @@ -85,10 +85,13 @@ import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.apache.wss4j.common.saml.builder.SAML2Constants; import org.apache.wss4j.common.util.DOM2Writer; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * In this test, a token (UsernameToken or SAMLToken) is validated and transformed into a SAML Assertion. */ -public class ValidateTokenTransformationUnitTest extends org.junit.Assert { +public class ValidateTokenTransformationUnitTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUnitTest.java index 97a6762..4fb7d56 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUnitTest.java @@ -40,10 +40,14 @@ import org.apache.cxf.ws.security.sts.provider.model.StatusType; import org.apache.cxf.ws.security.sts.provider.model.ValidateTargetType; import org.apache.cxf.ws.security.sts.provider.model.secext.BinarySecurityTokenType; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * Some unit tests for the validate operation. */ -public class ValidateUnitTest extends org.junit.Assert { +public class ValidateUnitTest { private static final QName QNAME_WST_STATUS = QNameConstants.WS_TRUST_FACTORY.createStatus(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUsernameTokenUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUsernameTokenUnitTest.java index 0e8dee1..cce8ea6 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUsernameTokenUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUsernameTokenUnitTest.java @@ -48,10 +48,13 @@ import org.apache.wss4j.common.crypto.Crypto; import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.common.principal.CustomTokenPrincipal; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for the validate operation to validate UsernameTokens. */ -public class ValidateUsernameTokenUnitTest extends org.junit.Assert { +public class ValidateUsernameTokenUnitTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateX509TokenUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateX509TokenUnitTest.java index efe2b8e..04da827 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateX509TokenUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateX509TokenUnitTest.java @@ -49,10 +49,13 @@ import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.common.crypto.CryptoType; import org.apache.wss4j.common.principal.CustomTokenPrincipal; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for the validate operation to validate X.509 tokens. */ -public class ValidateX509TokenUnitTest extends org.junit.Assert { +public class ValidateX509TokenUnitTest { public static final QName REQUESTED_SECURITY_TOKEN = QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(null).getName(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/request/RequestParserUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/request/RequestParserUnitTest.java index e95fced..5117c34 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/request/RequestParserUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/request/RequestParserUnitTest.java @@ -48,7 +48,10 @@ import org.apache.wss4j.dom.handler.RequestData; import org.apache.wss4j.dom.handler.WSHandlerConstants; import org.apache.wss4j.dom.handler.WSHandlerResult; -public class RequestParserUnitTest extends org.junit.Assert { +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +public class RequestParserUnitTest { private static final String SECURITY_HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><wsse:Security " diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/canceller/SCTCancellerTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/canceller/SCTCancellerTest.java index ee6cad5..39d53f3 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/canceller/SCTCancellerTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/canceller/SCTCancellerTest.java @@ -46,10 +46,14 @@ import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.apache.wss4j.dom.message.token.SecurityContextToken; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for cancelling a SecurityContextToken via the SCTCanceller. */ -public class SCTCancellerTest extends org.junit.Assert { +public class SCTCancellerTest { private static TokenStore tokenStore = new DefaultInMemoryTokenStore(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTClaimsTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTClaimsTest.java index 87b33c0..4a0683f 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTClaimsTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTClaimsTest.java @@ -47,10 +47,14 @@ import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * A unit test for creating JWT Tokens with various claims populated by a ClaimsHandler. */ -public class JWTClaimsTest extends org.junit.Assert { +public class JWTClaimsTest { public static final URI CLAIM_STATIC_COMPANY = URI.create("http://apache.org/claims/test/company"); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTProviderActAsTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTProviderActAsTest.java index 05b9dde..0e95d86 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTProviderActAsTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTProviderActAsTest.java @@ -49,10 +49,13 @@ import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.junit.Assert; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for creating JWT Tokens with an ActAs element. */ -public class JWTProviderActAsTest extends org.junit.Assert { +public class JWTProviderActAsTest { /** * Create a JWT Token with ActAs from a UsernameToken diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTProviderLifetimeTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTProviderLifetimeTest.java index 39dbaad..7e297bd 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTProviderLifetimeTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTProviderLifetimeTest.java @@ -43,11 +43,15 @@ import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.apache.wss4j.common.util.DateUtil; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * Some unit tests for creating JWT Tokens with lifetime */ -public class JWTProviderLifetimeTest extends org.junit.Assert { +public class JWTProviderLifetimeTest { /** * Issue JWT token with a valid requested lifetime diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTProviderOnBehalfOfTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTProviderOnBehalfOfTest.java index 6fd30bd..6c4b23e 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTProviderOnBehalfOfTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTProviderOnBehalfOfTest.java @@ -49,10 +49,13 @@ import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.junit.Assert; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for creating JWT Tokens with an OnBehalfOf element. */ -public class JWTProviderOnBehalfOfTest extends org.junit.Assert { +public class JWTProviderOnBehalfOfTest { /** * Create a JWT Token with OnBehalfOf from a UsernameToken diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTTokenProviderRealmTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTTokenProviderRealmTest.java index 47934a8..d1b8f67 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTTokenProviderRealmTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTTokenProviderRealmTest.java @@ -39,10 +39,14 @@ import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for creating JWT Tokens via the JWTTokenProvider in different realms */ -public class JWTTokenProviderRealmTest extends org.junit.Assert { +public class JWTTokenProviderRealmTest { @org.junit.Test public void testRealms() throws Exception { diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTTokenProviderTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTTokenProviderTest.java index 70b966e..a543b0d 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTTokenProviderTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTTokenProviderTest.java @@ -55,10 +55,14 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.junit.Assert; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for creating JWTTokens. */ -public class JWTTokenProviderTest extends org.junit.Assert { +public class JWTTokenProviderTest { private static boolean unrestrictedPoliciesInstalled; private static TokenStore tokenStore = new DefaultInMemoryTokenStore(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLClaimsTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLClaimsTest.java index 706fa2d..85573c9 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLClaimsTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLClaimsTest.java @@ -55,10 +55,16 @@ import org.apache.wss4j.common.util.DOM2Writer; import org.opensaml.core.xml.XMLObject; import org.opensaml.saml.saml2.core.Attribute; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * A unit test for creating a SAML Tokens with various Attributes populated by a ClaimsHandler. */ -public class SAMLClaimsTest extends org.junit.Assert { +public class SAMLClaimsTest { public static final String CLAIM_STATIC_COMPANY = "http://apache.org/claims/test/company"; diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java index a591e93..cc0865c 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java @@ -58,10 +58,14 @@ import org.opensaml.core.xml.XMLObject; import org.junit.Assert; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for creating SAML Tokens with an ActAs element. */ -public class SAMLProviderActAsTest extends org.junit.Assert { +public class SAMLProviderActAsTest { /** * Create a default Saml1 Bearer Assertion with ActAs from a UsernameToken diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderCustomTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderCustomTest.java index c78e302..238fa98 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderCustomTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderCustomTest.java @@ -42,10 +42,14 @@ import org.apache.wss4j.common.saml.builder.SAML1Constants; import org.apache.wss4j.common.saml.builder.SAML2Constants; import org.apache.wss4j.common.util.DOM2Writer; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for creating custom SAML Tokens. */ -public class SAMLProviderCustomTest extends org.junit.Assert { +public class SAMLProviderCustomTest { /** * Create a custom Saml1 Attribute Assertion. diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderKeyTypeTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderKeyTypeTest.java index 4007b52..8d8ea5b 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderKeyTypeTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderKeyTypeTest.java @@ -51,10 +51,16 @@ import org.apache.wss4j.common.saml.builder.SAML2Constants; import org.apache.wss4j.common.util.DOM2Writer; import org.apache.wss4j.dom.util.WSSecurityUtil; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * Some unit tests for creating SAML Tokens with various KeyType parameters via the SAMLTokenProvider. */ -public class SAMLProviderKeyTypeTest extends org.junit.Assert { +public class SAMLProviderKeyTypeTest { /** * Create a default Saml1 Bearer Assertion. diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderLifetimeTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderLifetimeTest.java index ea99d2d..51743f6 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderLifetimeTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderLifetimeTest.java @@ -43,12 +43,15 @@ import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.apache.wss4j.common.util.DOM2Writer; import org.apache.wss4j.common.util.DateUtil; - +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * Some unit tests for creating SAML Tokens with lifetime */ -public class SAMLProviderLifetimeTest extends org.junit.Assert { +public class SAMLProviderLifetimeTest { /** * Issue SAML 2 token with a valid requested lifetime diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderOnBehalfOfTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderOnBehalfOfTest.java index df97698..1e1911b 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderOnBehalfOfTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderOnBehalfOfTest.java @@ -47,10 +47,14 @@ import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.apache.wss4j.common.util.DOM2Writer; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for creating SAML Tokens with an OnBehalfOf element. */ -public class SAMLProviderOnBehalfOfTest extends org.junit.Assert { +public class SAMLProviderOnBehalfOfTest { /** * Create a default Saml1 Bearer Assertion with OnBehalfOf from a UsernameToken diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderRealmTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderRealmTest.java index f33011a..74d5010 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderRealmTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderRealmTest.java @@ -40,10 +40,14 @@ import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.apache.wss4j.common.util.DOM2Writer; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for creating SAML Tokens via the SAMLTokenProvider in different realms */ -public class SAMLProviderRealmTest extends org.junit.Assert { +public class SAMLProviderRealmTest { /** * Test that a SAML 1.1 Bearer Assertion is created in specific realms. diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SCTProviderTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SCTProviderTest.java index dbd497a..134f6f6 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SCTProviderTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SCTProviderTest.java @@ -40,10 +40,15 @@ import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.apache.wss4j.common.util.DOM2Writer; import org.apache.wss4j.dom.message.token.SecurityContextToken; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for creating SecurityContextTokens. */ -public class SCTProviderTest extends org.junit.Assert { +public class SCTProviderTest { private static TokenStore tokenStore = new DefaultInMemoryTokenStore(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/realm/RealmSupportTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/realm/RealmSupportTest.java index fe514a9..3c5f7fe 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/realm/RealmSupportTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/realm/RealmSupportTest.java @@ -36,7 +36,7 @@ import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.junit.Assert; -public class RealmSupportTest extends org.junit.Assert { +public class RealmSupportTest { @org.junit.Test diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerLifetimeTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerLifetimeTest.java index 03ec5c6..0cde131 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerLifetimeTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerLifetimeTest.java @@ -55,11 +55,15 @@ import org.apache.wss4j.common.util.DateUtil; import org.junit.BeforeClass; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * Some unit tests for renewing SAML Tokens with lifetime */ -public class SAMLTokenRenewerLifetimeTest extends org.junit.Assert { +public class SAMLTokenRenewerLifetimeTest { private static TokenStore tokenStore; diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerPOPTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerPOPTest.java index 1a25ce4..eafd86f 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerPOPTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerPOPTest.java @@ -68,11 +68,15 @@ import org.apache.wss4j.dom.handler.WSHandlerResult; import org.junit.BeforeClass; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * Some unit tests for renewing a SAML token via the SAMLTokenRenewer with proof of possession enabled * (message level, not TLS). */ -public class SAMLTokenRenewerPOPTest extends org.junit.Assert { +public class SAMLTokenRenewerPOPTest { private static TokenStore tokenStore; diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerRealmTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerRealmTest.java index 203173d..d12ec1d 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerRealmTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerRealmTest.java @@ -64,10 +64,13 @@ import org.apache.wss4j.common.util.DateUtil; import org.junit.BeforeClass; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for renewing a SAML token in different realms. */ -public class SAMLTokenRenewerRealmTest extends org.junit.Assert { +public class SAMLTokenRenewerRealmTest { private static TokenStore tokenStore; diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerTest.java index ad3c360..7079ada 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerTest.java @@ -60,10 +60,15 @@ import org.apache.wss4j.common.util.DateUtil; import org.junit.BeforeClass; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * Some unit tests for renewing a SAML token via the SAMLTokenRenewer. */ -public class SAMLTokenRenewerTest extends org.junit.Assert { +public class SAMLTokenRenewerTest { private static TokenStore tokenStore; diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/JWTTokenValidatorRealmTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/JWTTokenValidatorRealmTest.java index 67fec74..d95e2da 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/JWTTokenValidatorRealmTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/JWTTokenValidatorRealmTest.java @@ -53,10 +53,14 @@ import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for validating JWTTokens in different realms */ -public class JWTTokenValidatorRealmTest extends org.junit.Assert { +public class JWTTokenValidatorRealmTest { private static TokenStore tokenStore = new DefaultInMemoryTokenStore(); @org.junit.Test diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/JWTTokenValidatorTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/JWTTokenValidatorTest.java index 0d4967a..12909fc 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/JWTTokenValidatorTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/JWTTokenValidatorTest.java @@ -59,10 +59,13 @@ import org.apache.wss4j.common.ext.WSPasswordCallback; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for validating JWTTokens. */ -public class JWTTokenValidatorTest extends org.junit.Assert { +public class JWTTokenValidatorTest { private static TokenStore tokenStore = new DefaultInMemoryTokenStore(); @org.junit.Test diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SAMLTokenValidatorCachedRealmTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SAMLTokenValidatorCachedRealmTest.java index 2b822f5..6813ec0 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SAMLTokenValidatorCachedRealmTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SAMLTokenValidatorCachedRealmTest.java @@ -54,11 +54,14 @@ import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.junit.BeforeClass; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; /** * Some unit tests for validating a SAML token with a realm against the cached tokens realm. */ -public class SAMLTokenValidatorCachedRealmTest extends org.junit.Assert { +public class SAMLTokenValidatorCachedRealmTest { private static TokenStore tokenStore; diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SAMLTokenValidatorRealmTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SAMLTokenValidatorRealmTest.java index d8e6ecb..9440223 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SAMLTokenValidatorRealmTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SAMLTokenValidatorRealmTest.java @@ -50,10 +50,14 @@ import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + /** * Some unit tests for validating a SAML token in different realms via the SAMLTokenValidator. */ -public class SAMLTokenValidatorRealmTest extends org.junit.Assert { +public class SAMLTokenValidatorRealmTest { /** * Test a SAML 1.1 Assertion created in realm "A". diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SAMLTokenValidatorTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SAMLTokenValidatorTest.java index 2459a10..c9dc623 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SAMLTokenValidatorTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SAMLTokenValidatorTest.java @@ -71,11 +71,14 @@ import org.apache.wss4j.common.util.DateUtil; import org.junit.BeforeClass; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; /** * Some unit tests for validating a SAML token via the SAMLTokenValidator. */ -public class SAMLTokenValidatorTest extends org.junit.Assert { +public class SAMLTokenValidatorTest { private static TokenStore tokenStore; diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SCTValidatorTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SCTValidatorTest.java index d31b63a..f7aff79 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SCTValidatorTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SCTValidatorTest.java @@ -46,11 +46,14 @@ import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.apache.wss4j.dom.message.token.SecurityContextToken; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; /** * Some unit tests for validating a SecurityContextToken via the SCTValidator. */ -public class SCTValidatorTest extends org.junit.Assert { +public class SCTValidatorTest { private static TokenStore tokenStore = new DefaultInMemoryTokenStore(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/UsernameTokenValidatorTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/UsernameTokenValidatorTest.java index 34f614a..fc5d913 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/UsernameTokenValidatorTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/UsernameTokenValidatorTest.java @@ -48,11 +48,13 @@ import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.apache.wss4j.dom.message.token.UsernameToken; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; /** * Some unit tests for validating a UsernameToken via the UsernameTokenValidator. */ -public class UsernameTokenValidatorTest extends org.junit.Assert { +public class UsernameTokenValidatorTest { /** * Test a valid UsernameToken with password text diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/X509TokenValidatorTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/X509TokenValidatorTest.java index 56eca62..014f073 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/X509TokenValidatorTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/X509TokenValidatorTest.java @@ -43,11 +43,14 @@ import org.apache.wss4j.common.crypto.CryptoType; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; /** * Some unit tests for validating an X.509 Token via the X509TokenValidator. */ -public class X509TokenValidatorTest extends org.junit.Assert { +public class X509TokenValidatorTest { /** * Test a valid certificate diff --git a/services/wsn/wsn-core/src/test/java/org/apache/cxf/wsn/WsnBrokerTest.java b/services/wsn/wsn-core/src/test/java/org/apache/cxf/wsn/WsnBrokerTest.java index 15054a7..257bd5d 100644 --- a/services/wsn/wsn-core/src/test/java/org/apache/cxf/wsn/WsnBrokerTest.java +++ b/services/wsn/wsn-core/src/test/java/org/apache/cxf/wsn/WsnBrokerTest.java @@ -51,13 +51,14 @@ import org.oasis_open.docs.wsn.b_2.NotificationMessageHolderType; import org.oasis_open.docs.wsn.b_2.TopicExpressionType; import org.junit.After; -import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; - -public abstract class WsnBrokerTest extends Assert { +public abstract class WsnBrokerTest { private boolean useExternal; @@ -83,7 +84,7 @@ public abstract class WsnBrokerTest extends Assert { .setContextClassLoader(new FakeClassLoader(impl)); WSNHelper.getInstance().setClassLoader(false); - + port2 = getFreePort(); if (!useExternal) { diff --git a/testutils/src/main/java/org/apache/cxf/test/AbstractCXFTest.java b/testutils/src/main/java/org/apache/cxf/test/AbstractCXFTest.java index 787936a..78ae3cd 100644 --- a/testutils/src/main/java/org/apache/cxf/test/AbstractCXFTest.java +++ b/testutils/src/main/java/org/apache/cxf/test/AbstractCXFTest.java @@ -39,7 +39,6 @@ import org.apache.cxf.endpoint.Server; import org.apache.cxf.helpers.MapNamespaceContext; import org.junit.After; -import org.junit.Assert; import org.junit.Before; @@ -47,7 +46,7 @@ import org.junit.Before; * A basic test case meant for helping users unit test their services. * @see TestUtilities */ -public abstract class AbstractCXFTest extends Assert { +public abstract class AbstractCXFTest { protected TestUtilities testUtilities; protected Bus bus; diff --git a/testutils/src/main/java/org/apache/cxf/testutil/recorders/MessageRecorder.java b/testutils/src/main/java/org/apache/cxf/testutil/recorders/MessageRecorder.java index f1ce34b..a30e643 100644 --- a/testutils/src/main/java/org/apache/cxf/testutil/recorders/MessageRecorder.java +++ b/testutils/src/main/java/org/apache/cxf/testutil/recorders/MessageRecorder.java @@ -21,9 +21,9 @@ package org.apache.cxf.testutil.recorders; import java.util.List; -import org.junit.Assert; +import static org.junit.Assert.assertEquals; -public class MessageRecorder extends Assert { +public class MessageRecorder { private OutMessageRecorder outRecorder; private InMessageRecorder inRecorder; diff --git a/testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java b/testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java index d87b163..95067e3 100644 --- a/testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java +++ b/testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java @@ -26,10 +26,11 @@ import org.w3c.dom.Document; import org.apache.cxf.staxutils.StaxUtils; -import org.junit.Assert; import org.junit.Test; -public class XPathAssertTest extends Assert { +import static org.junit.Assert.fail; + +public class XPathAssertTest { @Test public void testAssert() throws Exception { diff --git a/testutils/src/test/java/org/apache/cxf/testutils/header_test/rpc/TestRPCHeaderTest.java b/testutils/src/test/java/org/apache/cxf/testutils/header_test/rpc/TestRPCHeaderTest.java index 3ca4418..e4c77ce 100644 --- a/testutils/src/test/java/org/apache/cxf/testutils/header_test/rpc/TestRPCHeaderTest.java +++ b/testutils/src/test/java/org/apache/cxf/testutils/header_test/rpc/TestRPCHeaderTest.java @@ -25,11 +25,12 @@ import javax.jws.WebParam; import org.apache.header_test.rpc.TestRPCHeader; -import org.junit.Assert; import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; -public class TestRPCHeaderTest extends Assert { +public class TestRPCHeaderTest { Class<TestRPCHeader> cls = TestRPCHeader.class; @Test
