You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "Petri Tuomola (Jira)" <ji...@apache.org> on 2020/05/30 05:04:00 UTC

[jira] [Commented] (FINERACT-1005) Fix Failing test in org.apache.fineract.integrationtests.StaffTest

    [ https://issues.apache.org/jira/browse/FINERACT-1005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17120113#comment-17120113 ] 

Petri Tuomola commented on FINERACT-1005:
-----------------------------------------

Looking at the first case: 

> testStaffUpdateWrongActiveState test returns 200 instead of expected 400 when updating isactive with wrong value.

That's actually quite interesting: 

There's a method validateForBooleanValue which is used everywhere else to check that an input is a boolean. The problem is that, in all the cases where it is used, the value to be checked is retrieved from the input JSON with extractBooleanNamed().

That extractBooleanNamed() in turn uses Boolean.parseBoolean() to get the boolean value from String. Boolean.parseBoolean returns true if and only if the string passed is "true". For all other strings it will return false.

So the whole use of validateForBooleanValue in all the APIs seems to be pointless: as we are checking value returned by Boolean.parseBoolean, the result is always true or false - regardless of what string is passed. 

Based on this, we would seem to have two options:
 * Accept the current semantics for all APIs: boolean values are true for string "true" and "false" for any other string (including "xyz" in this test)
 * Change all boolean validations to first validate the string passed to equal "true" or "false" before parsing it to a boolean

Or maybe I'm missing something here...

> Fix Failing test in org.apache.fineract.integrationtests.StaffTest 
> -------------------------------------------------------------------
>
>                 Key: FINERACT-1005
>                 URL: https://issues.apache.org/jira/browse/FINERACT-1005
>             Project: Apache Fineract
>          Issue Type: Bug
>            Reporter: Percy Ashu
>            Priority: Blocker
>
> testStaffUpdateWrongActiveState test returns 200 instead of expected 400 when updating isactive with wrong value.
> testStaffUpdateLongExternalIdError test returns 500 instead of 400
>  testStaffCreateMaxNameLength test show return 200 with number of characters 50 but seems the random generator generates an additional character which then cause the test to fail.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)