Skip to content

Commit d62860d

Browse files
author
Slimane AMAR
committed
Review
1 parent 855145e commit d62860d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/java/org/gridsuite/study/server/NetworkModificationTreeTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ void testNodeModificationInfos() throws Exception {
598598

599599
List<AbstractNode> children = root.getChildren();
600600
assertEquals(2, children.size());
601-
NetworkModificationNode n1 = (NetworkModificationNode) (children.get(0).getName().equals("n1") ? children.get(0) : children.get(1));
601+
NetworkModificationNode n1 = (NetworkModificationNode) (children.stream().filter(c -> c.getName().equals("n1")).findFirst().orElseThrow());
602602
NetworkModificationNodeInfoEntity n1Infos = networkModificationTreeService.getNetworkModificationNodeInfoEntity(n1.getId());
603603
RootNetworkNodeInfoEntity rootNetworkNodeInfoEntity = rootNetworkNodeInfoRepository.findByNodeInfoIdAndRootNetworkId(n1.getId(), firstRootNetworkUuid).orElseThrow(() -> new StudyException(StudyException.Type.ROOT_NETWORK_NOT_FOUND));
604604

@@ -669,7 +669,7 @@ void testNodeManipulation() throws Exception {
669669
node2.setName("niark");
670670
node1.setName("condriak");
671671
node1.setModificationGroupUuid(UUID.randomUUID());
672-
AbstractNode child = children.get(0).getName().equals("loadflow") ? children.get(0) : children.get(1);
672+
AbstractNode child = children.stream().filter(c -> c.getName().equals("loadflow")).findFirst().orElseThrow();
673673
createNode(root.getStudyId(), child, node2, userId);
674674
createNode(root.getStudyId(), child, node1, userId);
675675

0 commit comments

Comments
 (0)