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


##########
systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java:
##########
@@ -246,25 +246,32 @@ public void testEncryptedPassword() throws Exception {
             return;
         }
 
-        SpringBusFactory bf = new SpringBusFactory();
-        URL busFile = ActionTest.class.getResource(
-                      JavaUtils.isFIPSEnabled() 
-                      ? "client-fips.xml" : "client.xml");
-
-        Bus bus = bf.createBus(busFile.toString());
-        BusFactory.setDefaultBus(bus);
-        BusFactory.setThreadDefaultBus(bus);
-
-        URL wsdl = ActionTest.class.getResource("DoubleItAction.wsdl");
-        Service service = Service.create(wsdl, SERVICE_QNAME);
-        QName portQName = new QName(NAMESPACE, 
"DoubleItEncryptedPasswordPort");
-        DoubleItPortType port =
-                service.getPort(portQName, DoubleItPortType.class);
-        updateAddressPort(port, PORT);
-        assertEquals(50, port.doubleIt(25));
-
-        ((java.io.Closeable)port).close();
-        bus.shutdown(true);
+        try {
+            if (!JavaUtils.isFIPSEnabled()) {

Review Comment:
   @coheigea may I suggest please to have two independent test runs in Maven, 
non-FIPs as defaut:
   
   ```
   <plugin>
                   <groupId>org.apache.maven.plugins</groupId>
                   <artifactId>maven-surefire-plugin</artifactId>
                   <executions>
                       <execution>
                           <id>default-test</id>
                           <configuration>
                               <systemPropertyVariables>
   
<org.apache.wss4j.crypto.jasypt.useLegacyDefaultAlgorithm>true</org.apache.wss4j.crypto.jasypt.useLegacyDefaultAlgorithm>
                               </systemPropertyVariables>
                           </configuration>
                       </execution>
   </plugin>
   ```
   
   And FIPS one:
   
   ```
   <plugin>
                   <groupId>org.apache.maven.plugins</groupId>
                   <artifactId>maven-surefire-plugin</artifactId>
   
                       <execution>
                           <id>fips-test</id>
                           <goals>
                               <goal>test</goal>
                           </goals>
                           <configuration>
                               <systemPropertyVariables>
                                   
<org.apache.wss4j.crypto.jasypt.useLegacyDefaultAlgorithm>false</org.apache.wss4j.crypto.jasypt.useLegacyDefaultAlgorithm>
                               </systemPropertyVariables>
                           </configuration>
                       </execution>
                   </executions>
               </plugin>
   ```
   
   More than happy to help with that, it is very difficult to eliminate side 
effects of system properties in tests, 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to