Skip to content

Commit eee96ed

Browse files
committed
converted class to record
1 parent e90d017 commit eee96ed

File tree

2 files changed

+3
-23
lines changed

2 files changed

+3
-23
lines changed
Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,14 @@
11
package dev.dsf.bpe.test.json;
22

33
import com.fasterxml.jackson.annotation.JsonCreator;
4-
import com.fasterxml.jackson.annotation.JsonGetter;
54
import com.fasterxml.jackson.annotation.JsonProperty;
65

7-
public class JsonPojo
6+
public record JsonPojo(@JsonProperty("value-1") String value1, @JsonProperty("value-2") String value2)
87
{
9-
@JsonProperty("value-1")
10-
private final String value1;
11-
12-
@JsonProperty("value-2")
13-
private final String value2;
14-
158
@JsonCreator
169
public JsonPojo(@JsonProperty("value-1") String value1, @JsonProperty("value-2") String value2)
1710
{
1811
this.value1 = value1;
1912
this.value2 = value2;
2013
}
21-
22-
@JsonGetter
23-
public String getValue1()
24-
{
25-
return value1;
26-
}
27-
28-
@JsonGetter
29-
public String getValue2()
30-
{
31-
return value2;
32-
}
33-
3414
}

dsf-bpe/dsf-bpe-test-plugin-v2/src/main/java/dev/dsf/bpe/test/service/JsonVariableTestGet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public void getJsonVariable(Variables variables) throws Exception
2525
JsonPojo variable = variables.getVariable(JsonVariableTestSet.JSON_VARIABLE);
2626

2727
expectNotNull(variable);
28-
expectSame(JsonVariableTestSet.TEST_VALUE_1, variable.getValue1());
29-
expectSame(JsonVariableTestSet.TEST_VALUE_2, variable.getValue2());
28+
expectSame(JsonVariableTestSet.TEST_VALUE_1, variable.value1());
29+
expectSame(JsonVariableTestSet.TEST_VALUE_2, variable.value2());
3030
}
3131

3232
@PluginTest

0 commit comments

Comments
 (0)