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

Petri Tuomola commented on FINERACT-1474:
-----------------------------------------

Hmm... to me it just looks like test data being used to mock the server 
response and to verify the mocked response.

So the string "testResult" contains the hardcoded response from the server - 
this is being injected with Mockito to 
ThitsaWorksCreditBureauIntegrationWritePlatformServiceImpl so that when someone 
calls okHttpConnectionMethod they get this response. 

Then in the test the values extracted by 
ThitsaWorksCreditBureauIntegrationWritePlatformServiceImpl from that mock 
response are compared with the known constants e.g. subscriptionID to confirm 
the extraction routine works well.

So I don't think there's anything harmful here. assuming the IDs contained in 
the mock response are not real ones. And I doubt they are, given the instance 
is given as "qa-mmc..." and the institution as "Demo 1". 

If we want to be certain we could always just modify them by modifying the 
string testResult as well as the constants - it should not matter what they are 
as long as they are a) the same and b) syntactically correct.

 

> Remove hard-coded constant from ThitsaworksCreditBureauTest
> -----------------------------------------------------------
>
>                 Key: FINERACT-1474
>                 URL: https://issues.apache.org/jira/browse/FINERACT-1474
>             Project: Apache Fineract
>          Issue Type: Bug
>            Reporter: Michael Vorburger
>            Priority: Blocker
>
> https://www.gitguardian.com is telling me that it thinks that the constant 
> {{subscriptionKey}} (and probably others there such as {{subscriptionId}}) in 
> https://github.com/apache/fineract/blob/develop/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/ThitsaworksCreditBureauTest.java
>  is Not a Great Idea.
> I'm not sure what that's for, and won't have the time to look into it, but it 
> does seem curious, so I thought I would at least file this issue.
> [[email protected]] ([~ptuomola]) and [~aleks] ([~avidakovic] 
> [~vidakovic]) and [~awasum] FYI.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to