Skip to content

Commit 7d10cc5

Browse files
Adapting tests to groovy 4.0
1 parent 3e7b8b1 commit 7d10cc5

File tree

5 files changed

+6
-31
lines changed

5 files changed

+6
-31
lines changed

src/main/java/edu/ie3/datamodel/io/source/csv/CsvDataSource.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected CsvDataSource(String csvSep, String folderPath, FileNamingStrategy fil
8383
* @return a map containing the mapping of (fieldName to fieldValue) or an empty map if an error
8484
* occurred
8585
*/
86-
private Map<String, String> buildFieldsToAttributes(
86+
protected Map<String, String> buildFieldsToAttributes(
8787
final String csvRow, final String[] headline) {
8888

8989
TreeMap<String, String> insensitiveFieldsToAttributes =
@@ -171,7 +171,7 @@ protected String[] parseCsvRow(String csvRow, String csvSep) {
171171
* @deprecated only left for downward compatibility. Will be removed in a major release
172172
*/
173173
@Deprecated(since = "1.1.0", forRemoval = true)
174-
private String[] oldFieldVals(String csvSep, String csvRow) {
174+
protected String[] oldFieldVals(String csvSep, String csvRow) {
175175

176176
/*geo json support*/
177177
final String geoJsonRegex = "\\{.+?}}}";
@@ -237,7 +237,7 @@ private List<String> extractMatchingStrings(String regexString, String csvRow) {
237237
* @return either the first found instancen of {@link OperatorInput} or {@link
238238
* OperatorInput#NO_OPERATOR_ASSIGNED}
239239
*/
240-
private OperatorInput getFirstOrDefaultOperator(
240+
protected OperatorInput getFirstOrDefaultOperator(
241241
Collection<OperatorInput> operators,
242242
String operatorUuid,
243243
String entityClassName,

src/test/groovy/edu/ie3/datamodel/io/sink/InfluxDbSinkIT.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class InfluxDbSinkIT extends Specification {
6161
when:
6262
def connector = new InfluxDbConnector(influxDbContainer.url,"test_weather", "test_scenario")
6363
then:
64-
connector.connectionValid
64+
connector.isConnectionValid()
6565
}
6666

6767
def "An InfluxDbSink can persist a ResultEntity"() {

src/test/groovy/edu/ie3/datamodel/io/source/csv/CsvDataSourceTest.groovy

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,6 @@ class CsvDataSourceTest extends Specification {
3434
DummyCsvSource(String csvSep, String folderPath, FileNamingStrategy fileNamingStrategy) {
3535
super(csvSep, folderPath, fileNamingStrategy)
3636
}
37-
38-
Map<String, String> buildFieldsToAttributes(
39-
final String csvRow, final String[] headline) {
40-
return super.buildFieldsToAttributes(csvRow, headline)
41-
}
42-
43-
OperatorInput getFirstOrDefaultOperator(
44-
Collection<OperatorInput> operators, String operatorUuid, String entityClassName, String requestEntityUuid) {
45-
return super.getFirstOrDefaultOperator(operators, operatorUuid, entityClassName, requestEntityUuid)
46-
}
47-
48-
def <T extends UniqueEntity> Set<Map<String, String>> distinctRowsWithLog(
49-
Class<T> entityClass, Collection<Map<String, String>> allRows) {
50-
return super.distinctRowsWithLog(allRows, uuidExtractor, entityClass.simpleName, "UUID")
51-
}
52-
53-
String[] parseCsvRow(
54-
String csvRow, String csvSep) {
55-
return super.parseCsvRow(csvRow, csvSep)
56-
}
57-
58-
String[] oldFieldVals(
59-
String csvSep, String csvRow) {
60-
return super.oldFieldVals(csvSep, csvRow)
61-
}
6237
}
6338

6439
@Shared

src/test/groovy/edu/ie3/datamodel/io/source/influxdb/InfluxDbWeatherSourceCosmoIT.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class InfluxDbWeatherSourceCosmoIT extends Specification implements TestContaine
5454
def connector = new InfluxDbConnector(influxDbContainer.url,"test_weather", "test_scenario")
5555

5656
then:
57-
connector.connectionValid
57+
connector.isConnectionValid()
5858
}
5959

6060
def "An InfluxDbWeatherSource can read and correctly parse a single value for a specific date and coordinate"() {

src/test/groovy/edu/ie3/datamodel/io/source/influxdb/InfluxDbWeatherSourceIconIT.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class InfluxDbWeatherSourceIconIT extends Specification implements WeatherSource
5252
def connector = new InfluxDbConnector(influxDbContainer.url, "test_weather", "test_scenario")
5353

5454
then:
55-
connector.connectionValid
55+
connector.isConnectionValid()
5656
}
5757

5858
def "An InfluxDbWeatherSource can read and correctly parse a single value for a specific date and coordinate"() {

0 commit comments

Comments
 (0)