Skip to content

Commit 6496add

Browse files
authored
Merge branch 'dev' into ms/#1007-refactor-CsvFileConnector-and-CsvDataSource
2 parents eb47833 + 46f4095 commit 6496add

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
- Enhancing `VoltageLevel` with `equals` method [#1063](https://github.com/ie3-institute/PowerSystemDataModel/issues/1063)
1111

1212
### Fixed
13+
- Fixed `MappingEntryies` not getting processed by adding `Getter` methods for record fields [#1084](https://github.com/ie3-institute/PowerSystemDataModel/issues/1084)
1314

1415
### Changed
1516
- Improvements to the search for corner points in `IdCoordinateSource` [#1016](https://github.com/ie3-institute/PowerSystemDataModel/issues/1016)

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
id 'signing'
66
id 'pmd' // code check, working on source code
77
id 'com.diffplug.spotless' version '6.25.0' //code format
8-
id 'com.github.spotbugs' version '6.0.12' // code check, working on byte code
8+
id 'com.github.spotbugs' version '6.0.14' // code check, working on byte code
99
id 'de.undercouch.download' version '5.6.0'
1010
id 'kr.motd.sphinx' version '2.10.1' // documentation generation
1111
id 'jacoco' // java code coverage plugin
@@ -18,7 +18,7 @@ ext {
1818
javaVersion = JavaVersion.VERSION_17
1919
groovyVersion = "4.0"
2020
groovyBinaryVersion = "4.0.21"
21-
testcontainersVersion = '1.19.7'
21+
testcontainersVersion = '1.19.8'
2222

2323
scriptsLocation = 'gradle' + File.separator + 'scripts' + File.separator //location of script plugins
2424
}
@@ -73,7 +73,7 @@ dependencies {
7373
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
7474
testImplementation "org.spockframework:spock-core:2.3-groovy-$groovyVersion"
7575
testImplementation 'org.objenesis:objenesis:3.4' // Mock creation with constructor parameters
76-
testImplementation 'net.bytebuddy:byte-buddy:1.14.14' // Mocks of classes
76+
testImplementation 'net.bytebuddy:byte-buddy:1.14.15' // Mocks of classes
7777

7878
// testcontainers (docker framework for testing)
7979
testImplementation "org.testcontainers:testcontainers:$testcontainersVersion"
@@ -94,7 +94,7 @@ dependencies {
9494
runtimeOnly 'org.postgresql:postgresql:42.7.3' // postgresql jdbc driver required during runtime
9595

9696
implementation 'commons-io:commons-io:2.16.1' // I/O functionalities
97-
implementation 'commons-codec:commons-codec:1.16.1' // needed by commons-compress
97+
implementation 'commons-codec:commons-codec:1.17.0' // needed by commons-compress
9898
implementation 'org.apache.commons:commons-compress:1.26.1' // I/O functionalities
9999
}
100100

src/main/java/edu/ie3/datamodel/io/source/TimeSeriesMappingSource.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import edu.ie3.datamodel.io.factory.EntityData;
1111
import edu.ie3.datamodel.io.factory.timeseries.TimeSeriesMappingFactory;
1212
import edu.ie3.datamodel.models.input.InputEntity;
13+
import edu.ie3.datamodel.models.input.system.SystemParticipantInput;
14+
import edu.ie3.datamodel.models.timeseries.TimeSeries;
1315
import edu.ie3.datamodel.utils.Try;
1416
import edu.ie3.datamodel.utils.Try.*;
1517
import java.util.*;
@@ -75,6 +77,16 @@ private Try<MappingEntry, FactoryException> createMappingEntry(
7577
/** Class to represent one entry within the participant to time series mapping */
7678
public record MappingEntry(UUID participant, UUID timeSeries) implements InputEntity {
7779

80+
/** Returns the {@link UUID} of the {@link SystemParticipantInput}. */
81+
public UUID getParticipant() {
82+
return participant;
83+
}
84+
85+
/** Returns the {@link UUID} of the {@link TimeSeries}. */
86+
public UUID getTimeSeries() {
87+
return timeSeries;
88+
}
89+
7890
@Override
7991
public boolean equals(Object o) {
8092
if (this == o) return true;

src/test/groovy/edu/ie3/datamodel/io/processor/input/InputEntityProcessorTest.groovy

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package edu.ie3.datamodel.io.processor.input
77

88
import static edu.ie3.util.quantities.PowerSystemUnits.PU
99

10+
import edu.ie3.datamodel.io.source.TimeSeriesMappingSource
1011
import edu.ie3.datamodel.models.OperationTime
1112
import edu.ie3.datamodel.models.StandardUnits
1213
import edu.ie3.datamodel.models.UniqueEntity
@@ -626,6 +627,23 @@ class InputEntityProcessorTest extends Specification {
626627
actual == expected
627628
}
628629

630+
def "The InputEntityProcessor should serialize a provided MappingEntry correctly"() {
631+
given:
632+
def processor = new InputEntityProcessor(TimeSeriesMappingSource.MappingEntry)
633+
def validResult = new TimeSeriesMappingSource.MappingEntry(UUID.fromString("7eb7b296-f4c4-4020-acf3-e865453b5dbd"), UUID.fromString("bc581c6c-3044-48a1-aea1-5b2cb1370356"))
634+
635+
Map expectedResults = [
636+
"participant": "7eb7b296-f4c4-4020-acf3-e865453b5dbd",
637+
"timeSeries": "bc581c6c-3044-48a1-aea1-5b2cb1370356"
638+
]
639+
640+
when: "the entity is passed to the processor"
641+
def processingResult = processor.handleEntity(validResult)
642+
643+
then: "make sure that the result is as expected "
644+
processingResult == expectedResults
645+
}
646+
629647
def "The InputEntityProcessor should serialize an entity but ignore the operator field when OperatorInput is equal to NO_OPERATOR_ASSIGNED"() {
630648
given:
631649
InputEntityProcessor processor = new InputEntityProcessor(NodeInput)

0 commit comments

Comments
 (0)