Open
Conversation
Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
| assertFaultResultsEquals(orderedFaultResults, orderedFaultResultsDto); | ||
| } | ||
|
|
||
| private static void assertPagedFaultResultsEqualsSorted(ShortCircuitAnalysisResult result, List<org.gridsuite.shortcircuit.server.dto.FaultResult> faultResults) { |
Collaborator
There was a problem hiding this comment.
rename to assertPagedSortedFaultResultsEquals
| @@ -189,9 +189,14 @@ private static void assertResultsEquals(ShortCircuitAnalysisResult result, org.g | |||
|
|
|||
| private static void assertPagedFaultResultsEquals(ShortCircuitAnalysisResult result, List<org.gridsuite.shortcircuit.server.dto.FaultResult> faultResults) { | |||
Collaborator
There was a problem hiding this comment.
assertResultsEquals and assertPagedFaultResultsEquals are almost the same. One should be deleted
c0aee83 to
db5669b
Compare
|
| assertEquals(result.getFaultResults().size(), faultResults.size()); | ||
|
|
||
| // When we do not provide sort parameter to the request, order is not guaranteed, so we sort results here to not test their order | ||
| List<FaultResult> orderedFaultResults = result.getFaultResults().stream().sorted(Comparator.comparing(fr -> fr.getFault().getId())).toList(); |
Collaborator
There was a problem hiding this comment.
assertFaultResultsEquals() and assertSortedFaultResultsEquals() should be homogeneous.
Wether you assume that the results given as "ShortCircuitAnalysisResult result" are sorted and you don't need to sort them. Wether you assume they are not sorted and you should sort them in both methods
etiennehomer
approved these changes
Jan 17, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.