Conversation
timparsons
left a comment
There was a problem hiding this comment.
One small change, otherwise looks good!!
|
|
||
| public List<BrAPIGermplasm> getGermplasmByList(UUID programId, String listId) throws ApiException { | ||
| // get list germplasm names | ||
| BrAPIListDetails listData = brAPIListDAO.getListById(listId, programId).getResult(); |
There was a problem hiding this comment.
This should probably be broken up in to multiple lines to first check that there was a list that was returned before calling the getResults() method. Otherwise, this could throw a NullPointerException
There was a problem hiding this comment.
@timparsons Agreed. There is now a check in place prior to the call that a list was returned.
HMS17
left a comment
There was a problem hiding this comment.
Approving on assumption Tim's comments are addressed.
| BrAPIListsSingleResponse listResponse = brAPIListDAO.getListById(listId, programId); | ||
| if(Objects.nonNull(listResponse)) { | ||
| BrAPIListDetails listData = listResponse.getResult(); | ||
| List<String> germplasmNames = listData.getData(); |
There was a problem hiding this comment.
Sorry to be a stickler here, but should probably check that listData is not null before calling the getData() method
There was a problem hiding this comment.
Np, you're right of course! I added the other check.
7063cb3 to
4ca5a93
Compare
Description
Story: BI-1129
brapi/v2/GermplasmController.javawith the signatureprograms/<program-ID>/germplasm/lists/<list-ID>/records/brapi/v2/services/BrAPIGermplasmService.getGermplasmByList()created to fetch germplasm records in a listDependencies
none
Testing
Send a GET request
/v1/programs/<program-id>/germplasm/lists/<list-id>/records?sortField=importEntryNumber&sortOrder=ASC&page=0&pageSize=50and verify the response contains all germplasm records stored for the given program and list ID.
Checklist: