Skip to content

Commit

Permalink
Fix code smell
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
  • Loading branch information
flo-dup committed Oct 10, 2024
1 parent 88a5dde commit e3d3030
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@ class TestUnifyVoltageLevelColors extends AbstractTestCaseIidm {

@Override
public void setUp() throws IOException {
network = Networks.createNetworkWithTieLineInSubstation();
graphBuilder = new NetworkGraphBuilder(network);
substation = network.getSubstation("S1");
}

@Test
void testSubstationRegularVoltageLevelColors() {
svgParameters.setUnifyVoltageLevelColors(false);

Network network = Networks.createNetworkWithTieLineInSubstation();
graphBuilder = new NetworkGraphBuilder(network);
// build graph
SubstationGraph g = graphBuilder.buildSubstationGraph("S1");
SubstationGraph g = graphBuilder.buildSubstationGraph(substation.getId());

// Run layout
new VerticalSubstationLayoutFactory().create(g, new SmartVoltageLevelLayoutFactory(network)).run(layoutParameters);
Expand All @@ -50,10 +51,8 @@ void testSubstationRegularVoltageLevelColors() {
void testSubstationUnifiedVoltageLevelColors() {
svgParameters.setUnifyVoltageLevelColors(true);

Network network = Networks.createNetworkWithTieLineInSubstation();
graphBuilder = new NetworkGraphBuilder(network);
// build graph
SubstationGraph g = graphBuilder.buildSubstationGraph("S1");
SubstationGraph g = graphBuilder.buildSubstationGraph(substation.getId());

// Run layout
new VerticalSubstationLayoutFactory().create(g, new SmartVoltageLevelLayoutFactory(network)).run(layoutParameters);
Expand Down

0 comments on commit e3d3030

Please sign in to comment.