Re: [PR] [CXF-9042] Fixed non-idempotent unit tests [cxf]

2024-08-01 Thread via GitHub


reta commented on code in PR #1978:
URL: https://github.com/apache/cxf/pull/1978#discussion_r1695631017


##
services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateJWTTransformationTest.java:
##
@@ -206,7 +206,9 @@ public void testJWTToSAMLTransformationRealm() throws 
Exception {
 TokenProviderResponse providerResponse = createJWT();
 Element wrapper = 
createTokenWrapper((String)providerResponse.getToken());
 Document doc = wrapper.getOwnerDocument();
-wrapper = (Element)doc.appendChild(wrapper);
+if (doc.getDocumentElement() == null) {

Review Comment:
   ~@kaiyaok2 this change is a bit suspicious, why the document element will be 
null here?~ Git it from the description, thanks for explaining



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@cxf.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [CXF-9042] Fixed non-idempotent unit tests [cxf]

2024-08-01 Thread via GitHub


reta commented on code in PR #1978:
URL: https://github.com/apache/cxf/pull/1978#discussion_r1700902908


##
services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateJWTTransformationTest.java:
##
@@ -206,7 +206,9 @@ public void testJWTToSAMLTransformationRealm() throws 
Exception {
 TokenProviderResponse providerResponse = createJWT();
 Element wrapper = 
createTokenWrapper((String)providerResponse.getToken());
 Document doc = wrapper.getOwnerDocument();
-wrapper = (Element)doc.appendChild(wrapper);
+if (doc.getDocumentElement() == null) {

Review Comment:
   @kaiyaok2 I think this test should be refactored to create a new document 
(vs manipulating empty one which is static):
   
   ```
   private Element createTokenWrapper(String token) {
   Document doc = DOMUtils.createDocument();
   Element tokenWrapper = doc.createElementNS(null, "TokenWrapper");
   tokenWrapper.setTextContent(token);
   return tokenWrapper;
   }
   
   ```
   
   Could you please make a change? Thank you.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@cxf.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[PR] Bump cxf.hamcrest.version from 2.2 to 3.0 [cxf]

2024-08-01 Thread via GitHub


dependabot[bot] opened a new pull request, #1988:
URL: https://github.com/apache/cxf/pull/1988

   Bumps `cxf.hamcrest.version` from 2.2 to 3.0.
   Updates `org.hamcrest:hamcrest-library` from 2.2 to 3.0
   
   Release notes
   Sourced from https://github.com/hamcrest/JavaHamcrest/releases";>org.hamcrest:hamcrest-library's
 releases.
   
   Hamcrest v3.0
   Breaking Changes
   
   From version 3.0, the jar distributed to Maven Central is now compiled 
to Java 1.8 bytecode,
   and is not compatible with previous versions of Java. See [Issue https://redirect.github.com/hamcrest/JavaHamcrest/issues/331";>#331](https://redirect.github.com/hamcrest/JavaHamcrest/issues/331";>hamcrest/JavaHamcrest#331)
 and
   [PR https://redirect.github.com/hamcrest/JavaHamcrest/issues/411";>#411](https://redirect.github.com/hamcrest/JavaHamcrest/issues/411";>hamcrest/JavaHamcrest#411)
 for details. Developers who use Java 1.7 earlier can still depend upon 
hamcrest-2.2.jar.
   
   Improvements
   
   FileMatchersTest simplification ([PR https://redirect.github.com/hamcrest/JavaHamcrest/issues/389";>#389](https://redirect.github.com/hamcrest/JavaHamcrest/issues/389";>hamcrest/JavaHamcrest#389))
   License cleanup ([PR https://redirect.github.com/hamcrest/JavaHamcrest/issues/414";>#414](https://redirect.github.com/hamcrest/JavaHamcrest/issues/414";>hamcrest/JavaHamcrest#414),
  [PR https://redirect.github.com/hamcrest/JavaHamcrest/issues/415";>#415](https://redirect.github.com/hamcrest/JavaHamcrest/issues/415";>hamcrest/JavaHamcrest#415),
 see also  https://redirect.github.com/hamcrest/JavaHamcrest/issues/264";>#264,  
https://redirect.github.com/hamcrest/JavaHamcrest/issues/355";>#355,  
https://redirect.github.com/hamcrest/JavaHamcrest/issues/396";>#396, 
and  https://redirect.github.com/hamcrest/JavaHamcrest/issues/399";>#399)
   
   Hamcrest v3.0-rc1
   Breaking Changes
   
   From version 3.0, the jar distributed to Maven Central is now compiled 
to Java 1.8 bytecode, and is not compatible with previous versions of Java. See 
[Issue https://redirect.github.com/hamcrest/JavaHamcrest/issues/331";>#331](https://redirect.github.com/hamcrest/JavaHamcrest/issues/331";>hamcrest/JavaHamcrest#331)
 and [PR https://redirect.github.com/hamcrest/JavaHamcrest/issues/411";>#411](https://redirect.github.com/hamcrest/JavaHamcrest/issues/411";>hamcrest/JavaHamcrest#411)
 for details. Developers who use Java 1.7 earlier can still depend upon 
hamcrest-2.2.jar.
   
   Improvements
   
   FileMatchersTest simplification ([PR https://redirect.github.com/hamcrest/JavaHamcrest/issues/389";>#389](https://redirect.github.com/hamcrest/JavaHamcrest/issues/389";>hamcrest/JavaHamcrest#389))
   License cleanup ([PR https://redirect.github.com/hamcrest/JavaHamcrest/issues/414";>#414](https://redirect.github.com/hamcrest/JavaHamcrest/issues/414";>hamcrest/JavaHamcrest#414),
 [PR https://redirect.github.com/hamcrest/JavaHamcrest/issues/415";>#415](https://redirect.github.com/hamcrest/JavaHamcrest/issues/415";>hamcrest/JavaHamcrest#415),
 see also https://redirect.github.com/hamcrest/JavaHamcrest/issues/264";>#264,  
https://redirect.github.com/hamcrest/JavaHamcrest/issues/355";>#355, 
https://redirect.github.com/hamcrest/JavaHamcrest/issues/396";>#396, 
and https://redirect.github.com/hamcrest/JavaHamcrest/issues/399";>#399)
   
   
   
   
   Changelog
   Sourced from https://github.com/hamcrest/JavaHamcrest/blob/master/CHANGES.md";>org.hamcrest:hamcrest-library's
 changelog.
   
   Version 3.0 (1st August 2024)
   Breaking Changes
   
   From version 3.0, the jar distributed to Maven Central is now compiled 
to Java 1.8 bytecode,
   and is not compatible with previous versions of Java. See
   [Issue https://redirect.github.com/hamcrest/JavaHamcrest/issues/331";>#331](https://redirect.github.com/hamcrest/JavaHamcrest/issues/331";>hamcrest/JavaHamcrest#331)
 and
   [PR https://redirect.github.com/hamcrest/JavaHamcrest/issues/411";>#411](https://redirect.github.com/hamcrest/JavaHamcrest/issues/411";>hamcrest/JavaHamcrest#411)
 for details. Developers who use Java 1.7 earlier can still
   depend upon hamcrest-2.2.jar.
   
   Improvements
   
   FileMatchersTest simplification ([PR https://redirect.github.com/hamcrest/JavaHamcrest/issues/389";>#389](https://redirect.github.com/hamcrest/JavaHamcrest/issues/389";>hamcrest/JavaHamcrest#389))
   License cleanup ([PR https://redirect.github.com/hamcrest/JavaHamcrest/issues/414";>#414](https://redirect.github.com/hamcrest/JavaHamcrest/issues/414";>hamcrest/JavaHamcrest#414),
   [PR https://redirect.github.com/hamcrest/JavaHamcrest/issues/415";>#415](https://redirect.github.com/hamcrest/JavaHamcrest/issues/415";>hamcrest/JavaHamcrest#415),
 see also
   https://redirect.github.com/hamcrest/JavaHamcrest/issues/264";>#264,
   https://redirect.github.com/hamcrest/JavaHamcrest/issues/355";>#355,
   https://redirect.github.com/hamcrest/JavaHamcrest/issues/396";>#396,and
   https://redirect.github.com/hamcrest/JavaHamcres