oleksii-novikov-onix commented on code in PR #5763:
URL: https://github.com/apache/fineract/pull/5763#discussion_r3071451647


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/SavingsAccountTransactionTest.java:
##########
@@ -394,16 +399,21 @@ public void run() {
                 } else {
                     assertEquals(4, responses.size(), "Response size for 
without-enlosingTransaction response");
                     Integer statusCode1 = responses.get(0).getStatusCode();
+                    String msg1 = 
Strings.nullToEmpty(responses.get(0).getBody());
                     assertNotNull(statusCode1, "First 
without-enlosingTransaction response status code");
-                    assertTrue(SC_OK == statusCode1 || SC_CONFLICT == 
statusCode1,
-                            "First without-enlosingTransaction response status 
code: " + statusCode1);
+                    assertTrue(
+                            SC_OK == statusCode1
+                                    || SC_CONFLICT == statusCode1
+                                    || (SC_FORBIDDEN == statusCode1 && 
msg1.contains("Record has changed since last read")),

Review Comment:
   Matching on `Record has changed since last read` is fragile - if database 
changes the error message text in a future version, these tests will break 
again. If the exception were classified as `SomeConcurrencyException`(not sure, 
need to check what the actual exception being thrown is) at the `ErrorHandler` 
level instead, it would map to 409, and the tests would just work since they 
already accept SC_CONFLICT.



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