44import ocpp .cs ._2015 ._10 .StartTransactionRequest ;
55import org .joda .time .DateTime ;
66import org .junit .jupiter .api .Assertions ;
7+ import org .junit .jupiter .api .BeforeAll ;
78import org .junit .jupiter .api .Test ;
89import tools .jackson .databind .ObjectMapper ;
910import tools .jackson .databind .json .JsonMapper ;
1819
1920public class BeanValidationTest {
2021
21- private final ObjectMapper mapper = JsonMapper .builder ()
22- .addModule (new JodaModule ())
23- .addModule (new BeanValidationModule ())
24- .build ();
22+ private static ObjectMapper mapper ;
23+
24+ @ BeforeAll
25+ public static void setup () {
26+ mapper = JsonMapper .builder ()
27+ .addModule (new JodaModule ())
28+ .addModule (new BeanValidationModule ())
29+ .build ();
30+ }
2531
2632 @ Test
2733 public void nullFieldsOcpp12 () {
2834 String input = mapper .writeValueAsString (new ocpp .cs ._2010 ._08 .StartTransactionRequest ());
29- System .out .println (input );
3035
3136 var exception = assertThrows (ConstraintViolationException .class , () -> mapper .readValue (input , ocpp .cs ._2010 ._08 .StartTransactionRequest .class ));
3237
@@ -37,7 +42,6 @@ public void nullFieldsOcpp12() {
3742 @ Test
3843 public void nullFieldsOcpp15 () {
3944 String input = mapper .writeValueAsString (new ocpp .cs ._2012 ._06 .StartTransactionRequest ());
40- System .out .println (input );
4145
4246 var exception = assertThrows (ConstraintViolationException .class , () -> mapper .readValue (input , ocpp .cs ._2012 ._06 .StartTransactionRequest .class ));
4347
@@ -48,7 +52,6 @@ public void nullFieldsOcpp15() {
4852 @ Test
4953 public void nullFieldsOcpp16 () {
5054 String input = mapper .writeValueAsString (new ocpp .cs ._2015 ._10 .StartTransactionRequest ());
51- System .out .println (input );
5255
5356 var exception = assertThrows (ConstraintViolationException .class , () -> mapper .readValue (input , ocpp .cs ._2015 ._10 .StartTransactionRequest .class ));
5457
@@ -59,7 +62,6 @@ public void nullFieldsOcpp16() {
5962 @ Test
6063 public void nullFieldsOcpp16Security () {
6164 String input = mapper .writeValueAsString (new ocpp ._2022 ._02 .security .SecurityEventNotification ());
62- System .out .println (input );
6365
6466 var exception = assertThrows (ConstraintViolationException .class , () -> mapper .readValue (input , ocpp ._2022 ._02 .security .SecurityEventNotification .class ));
6567
@@ -70,7 +72,6 @@ public void nullFieldsOcpp16Security() {
7072 @ Test
7173 public void nullFieldsOcpp2 () {
7274 String input = mapper .writeValueAsString (new ocpp ._2020 ._03 .SecurityEventNotificationRequest ());
73- System .out .println (input );
7475
7576 var exception = assertThrows (ConstraintViolationException .class , () -> mapper .readValue (input , ocpp ._2020 ._03 .SecurityEventNotificationRequest .class ));
7677
0 commit comments