File tree 1 file changed +5
-5
lines changed
exonum-java-binding/time-oracle/src/test/java/com/exonum/binding/time
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 33
33
34
34
class UtcZonedDateTimeSerializerTest {
35
35
36
- private Serializer <ZonedDateTime > serializer = UtcZonedDateTimeSerializer .INSTANCE ;
36
+ private final Serializer <ZonedDateTime > SERIALIZER = UtcZonedDateTimeSerializer .INSTANCE ;
37
37
38
38
@ ParameterizedTest
39
39
@ MethodSource ("testSource" )
40
40
void roundTrip (ZonedDateTime key ) {
41
- byte [] bytes = serializer .toBytes (key );
42
- ZonedDateTime actual = serializer .fromBytes (bytes );
41
+ byte [] bytes = SERIALIZER .toBytes (key );
42
+ ZonedDateTime actual = SERIALIZER .fromBytes (bytes );
43
43
44
44
assertThat (actual , equalTo (key ));
45
45
}
46
46
47
47
@ Test
48
48
void deserializeInvalidValue () {
49
49
byte [] invalidValue = Bytes .bytes ();
50
- assertThrows (IllegalArgumentException .class , () -> serializer .fromBytes (invalidValue ));
50
+ assertThrows (IllegalArgumentException .class , () -> SERIALIZER .fromBytes (invalidValue ));
51
51
}
52
52
53
53
@ Test
54
54
void serializeNonUtcValue () {
55
55
ZonedDateTime value = ZonedDateTime .now (ZoneId .of ("Europe/Amsterdam" ));
56
- assertThrows (IllegalArgumentException .class , () -> serializer .toBytes (value ));
56
+ assertThrows (IllegalArgumentException .class , () -> SERIALIZER .toBytes (value ));
57
57
}
58
58
59
59
private static Stream <ZonedDateTime > testSource () {
You can’t perform that action at this time.
0 commit comments