diff --git a/pom.xml b/pom.xml index 48eec2d..22157b1 100644 --- a/pom.xml +++ b/pom.xml @@ -121,6 +121,8 @@ pom import + + @@ -181,24 +183,9 @@ powsybl-config-test test - - junit - junit - test - - - org.mockito - mockito-core - test - - - org.springframework - spring-test - test - org.springframework.boot - spring-boot-test-autoconfigure + spring-boot-starter-test test diff --git a/src/test/java/com/powsybl/sld/server/GeoDataServiceTest.java b/src/test/java/com/powsybl/sld/server/GeoDataServiceTest.java index f22ba5c..c99e7fb 100644 --- a/src/test/java/com/powsybl/sld/server/GeoDataServiceTest.java +++ b/src/test/java/com/powsybl/sld/server/GeoDataServiceTest.java @@ -7,12 +7,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.Country; import com.powsybl.network.store.client.NetworkStoreService; import com.powsybl.sld.server.dto.Coordinate; import com.powsybl.sld.server.dto.SubstationGeoData; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentMatchers; import org.mockito.InjectMocks; import org.mockito.Mock; @@ -22,83 +22,29 @@ import java.util.List; import java.util.UUID; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.when; -public class GeoDataServiceTest { +class GeoDataServiceTest { + private static final String BASE_URI = "http://geo-data-server/"; - private static final String VARIANT_1_ID = "variant_1"; - private static final String VARIANT_2_ID = "variant_2"; - private final String baseUri = "http://geo-data-server/"; @Mock private RestTemplate restTemplate; + @InjectMocks private GeoDataService geoDataService; + @Mock private NetworkStoreService networkStoreService; - public static Network createNetwork() { - Network network = Network.create("test", "test"); - Substation substationFr1 = network.newSubstation() - .setId("subFr1") - .setCountry(Country.FR) - .setTso("RTE") - .add(); - VoltageLevel voltageLevelFr1A = substationFr1.newVoltageLevel() - .setId("vlFr1A") - .setName("vlFr1A") - .setNominalV(440.0) - .setHighVoltageLimit(400.0) - .setLowVoltageLimit(200.0) - .setTopologyKind(TopologyKind.BUS_BREAKER) - .add(); - voltageLevelFr1A.getBusBreakerView().newBus() - .setId("busFr1A") - .setName("busFr1A") - .add(); - VoltageLevel voltageLevelFr1B = substationFr1.newVoltageLevel() - .setId("vlFr1B").setName("vlFr1B") - .setNominalV(200.0) - .setHighVoltageLimit(400.0) - .setLowVoltageLimit(200.0) - .setTopologyKind(TopologyKind.BUS_BREAKER) - .add(); - voltageLevelFr1B.getBusBreakerView().newBus() - .setId("busFr1B") - .setName("busFr1B") - .add(); - - Substation substationFr2 = network.newSubstation() - .setId("subFr2") - .setCountry(Country.FR) - .setTso("RTE") - .add(); - VoltageLevel voltageLevelFr2A = substationFr2.newVoltageLevel() - .setId("vlFr2A") - .setName("vlFr2A") - .setNominalV(440.0) - .setHighVoltageLimit(400.0) - .setLowVoltageLimit(200.0) - .setTopologyKind(TopologyKind.BUS_BREAKER) - .add(); - voltageLevelFr2A.getBusBreakerView().newBus() - .setId("busFr2A") - .setName("busFr2A") - .add(); - network.getVariantManager().cloneVariant(VariantManagerConstants.INITIAL_VARIANT_ID, VARIANT_1_ID); - network.getVariantManager().cloneVariant(VariantManagerConstants.INITIAL_VARIANT_ID, VARIANT_2_ID); - - return network; - } - - @Before - public void setUp() { + @BeforeEach + void setUp() { MockitoAnnotations.initMocks(this); - geoDataService.setGeoDataServerBaseUri(baseUri); + geoDataService.setGeoDataServerBaseUri(BASE_URI); } @Test - public void testGetSubstationsGraphics() { + void testGetSubstationsGraphics() { UUID networkUuid = UUID.randomUUID(); String variantId = "variant2"; List substationsIds = List.of("subFr1", "subFr2"); @@ -113,7 +59,7 @@ public void testGetSubstationsGraphics() { } @Test - public void testGetSubstationsGraphicsWithoutVariantId() { + void testGetSubstationsGraphicsWithoutVariantId() { UUID networkUuid = UUID.randomUUID(); List substationsIds = List.of("subFr1"); SubstationGeoData substationGeoData = new SubstationGeoData(); diff --git a/src/test/java/com/powsybl/sld/server/SingleLineDiagramTest.java b/src/test/java/com/powsybl/sld/server/SingleLineDiagramTest.java index cc300dc..714cf3b 100644 --- a/src/test/java/com/powsybl/sld/server/SingleLineDiagramTest.java +++ b/src/test/java/com/powsybl/sld/server/SingleLineDiagramTest.java @@ -33,27 +33,23 @@ import com.powsybl.sld.svg.FeederInfo; import com.powsybl.sld.svg.SvgParameters; import com.powsybl.sld.svg.styles.NominalVoltageStyleProvider; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.MockitoAnnotations; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.http.MediaType; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; import java.io.IOException; import java.io.StringWriter; -import java.io.UncheckedIOException; import java.nio.charset.StandardCharsets; import java.nio.file.FileSystem; import java.nio.file.Files; -import java.nio.file.Path; import java.util.List; import java.util.Map; import java.util.Objects; @@ -61,7 +57,7 @@ import static com.powsybl.sld.library.ComponentTypeName.ARROW_ACTIVE; import static com.powsybl.sld.library.ComponentTypeName.ARROW_REACTIVE; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.times; @@ -74,10 +70,9 @@ * @author Abdelsalem Hedhili * @author Franck Lecuyer */ -@RunWith(SpringRunner.class) @WebMvcTest(SingleLineDiagramController.class) @ContextConfiguration(classes = {SingleLineDiagramApplication.class}) -public class SingleLineDiagramTest { +class SingleLineDiagramTest { @Autowired private MockMvc mvc; @@ -102,22 +97,21 @@ public class SingleLineDiagramTest { private static final String VARIANT_2_ID = "variant_2"; private static final String VARIANT_NOT_FOUND_ID = "variant_notFound"; private FileSystem fileSystem; - private Path tmpDir; - @Before - public void setUp() throws IOException { + @BeforeEach + void setUp() throws Exception { MockitoAnnotations.initMocks(this); fileSystem = Jimfs.newFileSystem(Configuration.unix()); - tmpDir = Files.createDirectory(fileSystem.getPath("tmp")); + Files.createDirectory(fileSystem.getPath("tmp")); } - @After - public void tearDown() throws IOException { + @AfterEach + void tearDown() throws Exception { fileSystem.close(); } @Test - public void test() throws Exception { + void test() throws Exception { UUID testNetworkId = UUID.fromString("7928181c-7977-4592-ba19-88027e4254e4"); UUID notFoundNetworkId = UUID.fromString("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"); @@ -200,7 +194,7 @@ public void test() throws Exception { } @Test - public void testSubstations() throws Exception { + void testSubstations() throws Exception { UUID testNetworkId = UUID.fromString("7928181c-7977-4592-ba19-88027e4254e4"); UUID notFoundNetworkId = UUID.fromString("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"); @@ -281,7 +275,7 @@ public void testSubstations() throws Exception { } @Test - public void testComponentLibraries() throws Exception { + void testComponentLibraries() throws Exception { MvcResult result = mvc.perform(get("/v1/svg-component-libraries")) .andExpect(status().isOk()) .andReturn(); @@ -292,7 +286,7 @@ public void testComponentLibraries() throws Exception { private static final String GEO_DATA_SUBSTATIONS = "/geo_data_substations.json"; @Test - public void testAssignSubstationGeoData() throws Exception { + void testAssignSubstationGeoData() { UUID testNetworkId = UUID.fromString("7928181c-7977-4592-ba19-88027e4254e4"); given(networkStoreService.getNetwork(testNetworkId, PreloadingStrategy.COLLECTION)).willReturn(createNetwork()); Network network = networkStoreService.getNetwork(testNetworkId, PreloadingStrategy.COLLECTION); @@ -306,9 +300,8 @@ public void testAssignSubstationGeoData() throws Exception { String faultSubstationGeoDataJson = "[{\"id\":\"subFr1\",\"coordinate\":{\"lat\":48.8588443,\"long\":2.2943506}}]"; given(geoDataService.getSubstationsGraphics(testNetworkId, VARIANT_1_ID, List.of("subFr1"))).willReturn(faultSubstationGeoDataJson); - PowsyblException exception = assertThrows(PowsyblException.class, () -> { - networkAreaDiagramService.assignGeoDataCoordinates(network, testNetworkId, VARIANT_1_ID, List.of(network.getVoltageLevel("vlFr1A"))); - }); + PowsyblException exception = assertThrows(PowsyblException.class, () -> + networkAreaDiagramService.assignGeoDataCoordinates(network, testNetworkId, VARIANT_1_ID, List.of(network.getVoltageLevel("vlFr1A")))); // Assert the exception message assertEquals("Failed to parse JSON response", exception.getMessage()); @@ -316,7 +309,7 @@ public void testAssignSubstationGeoData() throws Exception { } @Test - public void testNetworkAreaDiagram() throws Exception { + void testNetworkAreaDiagram() throws Exception { UUID testNetworkId = UUID.fromString("7928181c-7977-4592-ba19-88027e4254e4"); UUID notFoundNetworkId = UUID.fromString("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"); @@ -349,7 +342,7 @@ public void testNetworkAreaDiagram() throws Exception { .andExpect(status().isNotFound()); } - public void testGenerateNadBasedOnGeoData(boolean withGeoData) { + private void testGenerateNadBasedOnGeoData(boolean withGeoData) throws Exception { UUID testNetworkId = UUID.fromString("7928181c-7977-4592-ba19-88027e4254e4"); given(networkStoreService.getNetwork(testNetworkId, PreloadingStrategy.COLLECTION)).willReturn(createNetwork()); given(geoDataService.getSubstationsGraphics(testNetworkId, VARIANT_2_ID, List.of("subFr1"))).willReturn(toString(GEO_DATA_SUBSTATIONS)); @@ -364,17 +357,17 @@ public void testGenerateNadBasedOnGeoData(boolean withGeoData) { } @Test - public void testGenerateNadWithoutGeoData() { + void testGenerateNadWithoutGeoData() throws Exception { testGenerateNadBasedOnGeoData(false); } @Test - public void testGenerateNadWithGeoData() { + void testGenerateNadWithGeoData() throws Exception { testGenerateNadBasedOnGeoData(true); } @Test - public void testNetworkAreaDiagramAdditionalMetadata() { + void testNetworkAreaDiagramAdditionalMetadata() throws Exception { UUID testNetworkId = UUID.fromString("7928181c-7977-4592-ba19-88027e4254e4"); given(networkStoreService.getNetwork(testNetworkId, PreloadingStrategy.COLLECTION)).willReturn(createNetwork()); @@ -383,11 +376,9 @@ public void testNetworkAreaDiagramAdditionalMetadata() { SvgAndMetadata svgAndMetadata = networkAreaDiagramService.generateNetworkAreaDiagramSvg(testNetworkId, VARIANT_2_ID, List.of("vlFr1A"), 2, true); Object additionalMetadata = svgAndMetadata.getAdditionalMetadata(); assertNotNull(additionalMetadata); - Map convertedMetadata = objectMapper.convertValue(additionalMetadata, new TypeReference<>() { - }); + Map convertedMetadata = objectMapper.convertValue(additionalMetadata, new TypeReference<>() { }); assertEquals(1, convertedMetadata.get("nbVoltageLevels")); - List> voltageLevels = objectMapper.convertValue(convertedMetadata.get("voltageLevels"), new TypeReference<>() { - }); + List> voltageLevels = objectMapper.convertValue(convertedMetadata.get("voltageLevels"), new TypeReference<>() { }); assertNotNull(voltageLevels); assertEquals(1, voltageLevels.size()); assertEquals("vlFr1A", voltageLevels.get(0).get("id")); @@ -396,7 +387,7 @@ public void testNetworkAreaDiagramAdditionalMetadata() { } @Test - public void testVoltageLevelSingleLineDiagramAdditionalMetadata() { + void testVoltageLevelSingleLineDiagramAdditionalMetadata() { UUID testNetworkId = UUID.fromString("7928181c-7977-4592-ba19-88027e4254e4"); given(networkStoreService.getNetwork(testNetworkId, null)).willReturn(createNetwork()); @@ -415,8 +406,7 @@ public void testVoltageLevelSingleLineDiagramAdditionalMetadata() { SvgAndMetadata svgAndMetadata = singleLineDiagramService.generateSvgAndMetadata(testNetworkId, VARIANT_2_ID, "vlFr1A", parameters); Object additionalMetadata = svgAndMetadata.getAdditionalMetadata(); assertNotNull(additionalMetadata); - Map convertedMetadata = objectMapper.convertValue(additionalMetadata, new TypeReference<>() { - }); + Map convertedMetadata = objectMapper.convertValue(additionalMetadata, new TypeReference<>() { }); assertEquals("vlFr1A", convertedMetadata.get("id")); assertEquals("vlFr1A", convertedMetadata.get("name")); assertEquals("FR", convertedMetadata.get("country")); @@ -424,7 +414,7 @@ public void testVoltageLevelSingleLineDiagramAdditionalMetadata() { } @Test - public void testSubstationSingleLineDiagramAdditionalMetadata() { + void testSubstationSingleLineDiagramAdditionalMetadata() { UUID testNetworkId = UUID.fromString("7928181c-7977-4592-ba19-88027e4254e4"); given(networkStoreService.getNetwork(testNetworkId, null)).willReturn(createNetwork()); @@ -443,14 +433,13 @@ public void testSubstationSingleLineDiagramAdditionalMetadata() { SvgAndMetadata svgAndMetadata = singleLineDiagramService.generateSvgAndMetadata(testNetworkId, VARIANT_2_ID, "subFr1", parameters); Object additionalMetadata = svgAndMetadata.getAdditionalMetadata(); assertNotNull(additionalMetadata); - Map convertedMetadata = objectMapper.convertValue(additionalMetadata, new TypeReference<>() { - }); + Map convertedMetadata = objectMapper.convertValue(additionalMetadata, new TypeReference<>() { }); assertEquals("subFr1", convertedMetadata.get("id")); assertNull(convertedMetadata.get("name")); assertEquals("FR", convertedMetadata.get("country")); } - public static Network createNetwork() { + private static Network createNetwork() { Network network = Network.create("test", "test"); Substation substationFr1 = network.newSubstation() .setId("subFr1") @@ -535,7 +524,7 @@ public static Network createNetwork() { } @Test - public void testPositionDiagramLabelProvider() throws IOException { + void testPositionDiagramLabelProvider() throws Exception { var testNetwork = createNetworkWithTwoInjectionAndOneBranchAndOne3twt(); var layoutParameters = new LayoutParameters(); var svgParameters = new SvgParameters(); @@ -576,7 +565,7 @@ public void testPositionDiagramLabelProvider() throws IOException { } @Test - public void testNetworkAreaDiagramWithMissingVoltageLevel() throws Exception { + void testNetworkAreaDiagramWithMissingVoltageLevel() throws Exception { UUID testNetworkId = UUID.fromString("7928181c-7977-4592-ba19-88027e4254e4"); given(networkStoreService.getNetwork(testNetworkId, PreloadingStrategy.COLLECTION)).willReturn(createNetwork()); given(geoDataService.getSubstationsGraphics(testNetworkId, VARIANT_2_ID, List.of("subFr1"))).willReturn(toString(GEO_DATA_SUBSTATIONS)); @@ -594,36 +583,21 @@ public void testNetworkAreaDiagramWithMissingVoltageLevel() throws Exception { .andExpect(status().isNotFound()); } - public static String toString(Path outPath) { - String content; - try { - byte[] encoded = Files.readAllBytes(outPath); - content = new String(encoded, StandardCharsets.UTF_8); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - return content; - } - - public String toString(String resourceName) { - try { - return new String(ByteStreams.toByteArray(Objects.requireNonNull(getClass().getResourceAsStream(resourceName))), StandardCharsets.UTF_8); - } catch (IOException e) { - throw new UncheckedIOException(e); - } + private static String toString(String resourceName) throws IOException { + return new String(ByteStreams.toByteArray(Objects.requireNonNull(SingleLineDiagramTest.class.getResourceAsStream(resourceName))), StandardCharsets.UTF_8); } /* #TODO replace it with already configured FourSubstationsNodeBreakerWithExtensionsFactory when migrating to next powsybl release */ - public Network createNetworkWithTwoInjectionAndOneBranchAndOne3twt() { + private static Network createNetworkWithTwoInjectionAndOneBranchAndOne3twt() { Network network = Network.create("TestSingleLineDiagram", "test"); Substation substation = createSubstation(network, "s", "s", Country.FR); Substation substation2 = createSubstation(network, "s2", "s2", Country.FR); - VoltageLevel vl1 = createVoltageLevel(substation, "vl1", "vl1", TopologyKind.NODE_BREAKER, 380, 10); - VoltageLevel vl2 = createVoltageLevel(substation, "vl2", "vl2", TopologyKind.NODE_BREAKER, 225, 30); - VoltageLevel vl3 = createVoltageLevel(substation, "vl3", "vl3", TopologyKind.NODE_BREAKER, 225, 30); - VoltageLevel vl4 = createVoltageLevel(substation2, "vl4", "vl4", TopologyKind.NODE_BREAKER, 220, 20); + VoltageLevel vl1 = createVoltageLevel(substation, "vl1", "vl1", TopologyKind.NODE_BREAKER, 380); + VoltageLevel vl2 = createVoltageLevel(substation, "vl2", "vl2", TopologyKind.NODE_BREAKER, 225); + VoltageLevel vl3 = createVoltageLevel(substation, "vl3", "vl3", TopologyKind.NODE_BREAKER, 225); + VoltageLevel vl4 = createVoltageLevel(substation2, "vl4", "vl4", TopologyKind.NODE_BREAKER, 220); createBusBarSection(vl1, "bbs11", "bbs11", 2, 2, 2); createLoad(vl1, "loadA", "loadA", "loadA", 0, ConnectablePosition.Direction.TOP, 4, 10, 10); @@ -653,7 +627,7 @@ public Network createNetworkWithTwoInjectionAndOneBranchAndOne3twt() { return network; } - private Substation createSubstation(Network n, String id, String name, Country country) { + private static Substation createSubstation(Network n, String id, String name, Country country) { return n.newSubstation() .setId(id) .setName(name) @@ -661,19 +635,17 @@ private Substation createSubstation(Network n, String id, String name, Country c .add(); } - private VoltageLevel createVoltageLevel(Substation s, String id, String name, - TopologyKind topology, double vNom, int nodeCount) { - VoltageLevel vl = s.newVoltageLevel() + private static VoltageLevel createVoltageLevel(Substation s, String id, String name, TopologyKind topology, double vNom) { + return s.newVoltageLevel() .setId(id) .setName(name) .setTopologyKind(topology) .setNominalV(vNom) .add(); - return vl; } - private void createLoad(VoltageLevel vl, String id, String name, String feederName, Integer feederOrder, - ConnectablePosition.Direction direction, int node, double p0, double q0) { + private static void createLoad(VoltageLevel vl, String id, String name, String feederName, Integer feederOrder, + ConnectablePosition.Direction direction, int node, double p0, double q0) { Load load = vl.newLoad() .setId(id) .setName(name) @@ -684,7 +656,7 @@ private void createLoad(VoltageLevel vl, String id, String name, String feederNa addFeederPosition(load, feederName, feederOrder, direction); } - private void createSwitch(VoltageLevel vl, String id, String name, SwitchKind kind, boolean retained, boolean open, boolean fictitious, int node1, int node2) { + private static void createSwitch(VoltageLevel vl, String id, String name, SwitchKind kind, boolean retained, boolean open, boolean fictitious, int node1, int node2) { vl.getNodeBreakerView().newSwitch() .setId(id) .setName(name) @@ -697,7 +669,7 @@ private void createSwitch(VoltageLevel vl, String id, String name, SwitchKind ki .add(); } - private void createBusBarSection(VoltageLevel vl, String id, String name, int node, int busbarIndex, int sectionIndex) { + private static void createBusBarSection(VoltageLevel vl, String id, String name, int node, int busbarIndex, int sectionIndex) { BusbarSection bbs = vl.getNodeBreakerView().newBusbarSection() .setId(id) .setName(name) @@ -709,13 +681,13 @@ private void createBusBarSection(VoltageLevel vl, String id, String name, int no .add(); } - private void createTwoWindingsTransformer(Substation s, String id, String name, - double r, double x, double g, double b, - double ratedU1, double ratedU2, - int node1, int node2, - String idVoltageLevel1, String idVoltageLevel2, - String feederName1, Integer feederOrder1, ConnectablePosition.Direction direction1, - String feederName2, Integer feederOrder2, ConnectablePosition.Direction direction2) { + private static void createTwoWindingsTransformer(Substation s, String id, String name, + double r, double x, double g, double b, + double ratedU1, double ratedU2, + int node1, int node2, + String idVoltageLevel1, String idVoltageLevel2, + String feederName1, Integer feederOrder1, ConnectablePosition.Direction direction1, + String feederName2, Integer feederOrder2, ConnectablePosition.Direction direction2) { TwoWindingsTransformer t = s.newTwoWindingsTransformer() .setId(id) .setName(name) @@ -733,16 +705,16 @@ private void createTwoWindingsTransformer(Substation s, String id, String name, addTwoFeedersPosition(t, feederName1, feederOrder1, direction1, feederName2, feederOrder2, direction2); } - private void createThreeWindingsTransformer(Substation s, String id, String name, - String vl1, String vl2, String vl3, - double r1, double r2, double r3, - double x1, double x2, double x3, - double g1, double b1, - double ratedU1, double ratedU2, double ratedU3, - int node1, int node2, int node3, - String feederName1, Integer feederOrder1, ConnectablePosition.Direction direction1, - String feederName2, Integer feederOrder2, ConnectablePosition.Direction direction2, - String feederName3, Integer feederOrder3, ConnectablePosition.Direction direction3) { + private static void createThreeWindingsTransformer(Substation s, String id, String name, + String vl1, String vl2, String vl3, + double r1, double r2, double r3, + double x1, double x2, double x3, + double g1, double b1, + double ratedU1, double ratedU2, double ratedU3, + int node1, int node2, int node3, + String feederName1, Integer feederOrder1, ConnectablePosition.Direction direction1, + String feederName2, Integer feederOrder2, ConnectablePosition.Direction direction2, + String feederName3, Integer feederOrder3, ConnectablePosition.Direction direction3) { ThreeWindingsTransformer t = s.newThreeWindingsTransformer() .setId(id) .setName(name) @@ -774,9 +746,9 @@ private void createThreeWindingsTransformer(Substation s, String id, String name addThreeFeedersPosition(t, feederName1, feederOrder1, direction1, feederName2, feederOrder2, direction2, feederName3, feederOrder3, direction3); } - private void addTwoFeedersPosition(Extendable extendable, - String feederName1, Integer feederOrder1, ConnectablePosition.Direction direction1, - String feederName2, Integer feederOrder2, ConnectablePosition.Direction direction2) { + private static void addTwoFeedersPosition(Extendable extendable, + String feederName1, Integer feederOrder1, ConnectablePosition.Direction direction1, + String feederName2, Integer feederOrder2, ConnectablePosition.Direction direction2) { ConnectablePositionAdder extensionAdder = extendable.newExtension(ConnectablePositionAdder.class); ConnectablePositionAdder.FeederAdder feederAdder1 = extensionAdder.newFeeder1(); if (feederOrder1 != null) { @@ -791,7 +763,7 @@ private void addTwoFeedersPosition(Extendable extendable, extensionAdder.add(); } - private void addThreeFeedersPosition(Extendable extendable, + private static void addThreeFeedersPosition(Extendable extendable, String feederName1, Integer feederOrder1, ConnectablePosition.Direction direction1, String feederName2, Integer feederOrder2, ConnectablePosition.Direction direction2, String feederName3, Integer feederOrder3, ConnectablePosition.Direction direction3) { @@ -814,7 +786,7 @@ private void addThreeFeedersPosition(Extendable extendable, extensionAdder.add(); } - private void addFeederPosition(Extendable extendable, String feederName, Integer feederOrder, ConnectablePosition.Direction direction) { + private static void addFeederPosition(Extendable extendable, String feederName, Integer feederOrder, ConnectablePosition.Direction direction) { ConnectablePositionAdder.FeederAdder feederAdder = extendable.newExtension(ConnectablePositionAdder.class).newFeeder(); if (feederOrder != null) { feederAdder.withOrder(feederOrder);