Skip to content

Commit

Permalink
Improvements after review comments
Browse files Browse the repository at this point in the history
Signed-off-by: BOUHOURS Antoine <[email protected]>
  • Loading branch information
antoinebhs committed Dec 19, 2023
1 parent d75f6a0 commit 00dde0b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public enum ModificationType {
GENERATOR_CREATION(PreloadingStrategy.NONE),
GENERATOR_MODIFICATION(PreloadingStrategy.NONE),
EQUIPMENT_DELETION(PreloadingStrategy.NONE),
BY_FILTER_DELETION(PreloadingStrategy.NONE),
BY_FILTER_DELETION(PreloadingStrategy.COLLECTION),
LINE_CREATION(PreloadingStrategy.NONE),
LINE_MODIFICATION(PreloadingStrategy.NONE),
TWO_WINDINGS_TRANSFORMER_CREATION(PreloadingStrategy.NONE),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,9 @@ public ByFilterDeletionInfos toModificationInfos() {
.uuid(getId())
.date(getDate())
.stashed(getStashed())
.filters(this.getFilters().stream()
.filters(getFilters().stream()
.map(filter -> new FilterInfos(filter.getFilterId(), filter.getName()))
.collect(Collectors.toList()))
.equipmentType(getEquipmentType()).build();
}

@Override
public boolean equals(Object o) {
return super.equals(o);
}

@Override
public int hashCode() {
return super.hashCode();
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package org.gridsuite.modification.server.modifications;
package org.gridsuite.modification.server.modifications.byfilterdeletion;

import com.fasterxml.jackson.core.type.TypeReference;
import com.github.tomakehurst.wiremock.client.WireMock;
import com.github.tomakehurst.wiremock.matching.StringValuePattern;
import com.powsybl.iidm.network.IdentifiableType;
import lombok.SneakyThrows;
import org.gridsuite.modification.server.dto.*;
import org.gridsuite.modification.server.modifications.AbstractNetworkModificationTest;
import org.junit.Test;
import org.springframework.http.MediaType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

package org.gridsuite.modification.server.modifications;
package org.gridsuite.modification.server.modifications.byfilterdeletion;

import com.powsybl.iidm.network.IdentifiableType;
import com.powsybl.iidm.network.Network;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package org.gridsuite.modification.server.modifications;
package org.gridsuite.modification.server.modifications.byfilterdeletion;

import com.powsybl.iidm.network.IdentifiableType;
import com.powsybl.iidm.network.Network;
Expand Down Expand Up @@ -64,6 +64,7 @@ protected String getEquipmentNotFoundMessage() {
return "Substation not found";
}

@Override
protected List<FilterEquipments> getTestFilters() {
IdentifiableAttributes substation1 = getIdentifiableAttributes(SUBSTATION_ID_1);
IdentifiableAttributes substation2 = getIdentifiableAttributes(SUBSTATION_ID_2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package org.gridsuite.modification.server.modifications;
package org.gridsuite.modification.server.modifications.byfilterdeletion;

import com.powsybl.iidm.network.IdentifiableType;
import com.powsybl.iidm.network.Network;
Expand All @@ -30,9 +30,6 @@ public class VoltageLevelByFilterDeletionTest extends AbstractByFilterDeletionTe
private static final String VOLTAGE_LEVEL_ID_3 = "v3";
private static final String VOLTAGE_LEVEL_ID_4 = "v4";

public static final String PATH = "/v1/filters/export";
public static final String VOLTAGE_LEVEL_WRONG_ID_1 = "wrongId1";

@Before
public void specificSetUp() {
FilterService.setFilterServerBaseUri(wireMockServer.baseUrl());
Expand Down Expand Up @@ -70,6 +67,7 @@ protected String getEquipmentNotFoundMessage() {
return "Voltage level not found";
}

@Override
protected List<FilterEquipments> getTestFilters() {
IdentifiableAttributes vl1 = getIdentifiableAttributes(VOLTAGE_LEVEL_ID_1);
IdentifiableAttributes vl2 = getIdentifiableAttributes(VOLTAGE_LEVEL_ID_2);
Expand Down

0 comments on commit 00dde0b

Please sign in to comment.