adamsaghy commented on code in PR #5993:
URL: https://github.com/apache/fineract/pull/5993#discussion_r3435665863


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/PasswordPreferencesIntegrationTest.java:
##########
@@ -36,51 +30,35 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@SuppressWarnings({ "rawtypes", "unchecked" })
 public class PasswordPreferencesIntegrationTest {
 
     private static final Logger LOG = 
LoggerFactory.getLogger(PasswordPreferencesIntegrationTest.class);
-    private ResponseSpecification responseSpec;
-    private RequestSpecification requestSpec;
-    private ResponseSpecification generalResponseSpec;
     private int originalPasswordPolicyId;
 
     @BeforeEach
     public void setUp() {
         Utils.initializeRESTAssured();
-        this.requestSpec = new 
RequestSpecBuilder().setContentType(ContentType.JSON).build();
-        this.requestSpec.header("Authorization", "Basic " + 
Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
-        this.responseSpec = new 
ResponseSpecBuilder().expectStatusCode(200).build();
-        this.generalResponseSpec = new ResponseSpecBuilder().build();
-        originalPasswordPolicyId = 
PasswordPreferencesHelper.getActivePasswordPreference(requestSpec, 
responseSpec);
+        originalPasswordPolicyId = 
PasswordPreferencesHelper.getActivePasswordPreference().getId().intValue();
     }
 
     @AfterEach
     void tearDown() {
-        PasswordPreferencesHelper.updatePasswordPreferences(requestSpec, 
responseSpec, Integer.toString(originalPasswordPolicyId));
+        
PasswordPreferencesHelper.updatePasswordPreferences(Integer.toString(originalPasswordPolicyId));
     }
 
     @Test
     public void updatePasswordPreferences() {
         String validationPolicyId = "2";
-        PasswordPreferencesHelper.updatePasswordPreferences(requestSpec, 
responseSpec, validationPolicyId);
-        this.validateIfThePasswordIsUpdated(validationPolicyId);
-    }
-
-    private void validateIfThePasswordIsUpdated(String validationPolicyId) {
-        Integer id = 
PasswordPreferencesHelper.getActivePasswordPreference(requestSpec, 
responseSpec);
+        
PasswordPreferencesHelper.updatePasswordPreferences(validationPolicyId);
+        Integer id = 
PasswordPreferencesHelper.getActivePasswordPreference().getId().intValue();

Review Comment:
   please dont work with `Long.intValue()` -> remove them.



-- 
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