22
22
import com .google .gson .reflect .TypeToken ;
23
23
import com .google .gson .stream .JsonReader ;
24
24
import io .kubernetes .client .openapi .models .V1ListMeta ;
25
+ import io .kubernetes .client .openapi .models .V1ObjectMeta ;
25
26
import io .kubernetes .client .openapi .models .V1Status ;
26
27
import okio .ByteString ;
28
+ import org .junit .jupiter .api .MethodOrderer .OrderAnnotation ;
29
+ import org .junit .jupiter .api .Order ;
27
30
import org .junit .jupiter .api .Test ;
31
+ import org .junit .jupiter .api .TestMethodOrder ;
28
32
33
+ @ TestMethodOrder (OrderAnnotation .class )
29
34
class JSONTest {
30
35
31
- private final JSON json = new JSON ();
36
+ @ Order (0 )
37
+ @ Test
38
+ void serializeWithStaticMethod () {
39
+ JSON .serialize (new V1ObjectMeta ());
40
+ }
32
41
33
42
@ Test
34
43
void serializeByteArray () {
44
+ JSON json = new JSON ();
35
45
final String plainText = "string that contains '=' when encoded" ;
36
46
final String base64String = json .serialize (plainText .getBytes ());
37
47
// serialize returns string surrounded by quotes: "\"[base64]\""
@@ -48,6 +58,7 @@ void serializeByteArray() {
48
58
49
59
@ Test
50
60
void offsetDateTime1e6Parse () {
61
+ JSON json = new JSON ();
51
62
String timeStr = "\" 2018-04-03T11:32:26.123456Z\" " ;
52
63
OffsetDateTime dateTime = json .deserialize (timeStr , OffsetDateTime .class );
53
64
String serializedTsStr = json .serialize (dateTime );
@@ -56,6 +67,7 @@ void offsetDateTime1e6Parse() {
56
67
57
68
@ Test
58
69
void offsetDateTime1e4Parse () {
70
+ JSON json = new JSON ();
59
71
String timeStr = "\" 2018-04-03T11:32:26.1234Z\" " ;
60
72
OffsetDateTime dateTime = json .deserialize (timeStr , OffsetDateTime .class );
61
73
String serializedTsStr = json .serialize (dateTime );
@@ -65,6 +77,7 @@ void offsetDateTime1e4Parse() {
65
77
66
78
@ Test
67
79
void offsetDateTime1e3Parse () {
80
+ JSON json = new JSON ();
68
81
String timeStr = "\" 2018-04-03T11:32:26.123Z\" " ;
69
82
OffsetDateTime dateTime = json .deserialize (timeStr , OffsetDateTime .class );
70
83
String serializedTsStr = json .serialize (dateTime );
@@ -74,6 +87,7 @@ void offsetDateTime1e3Parse() {
74
87
75
88
@ Test
76
89
void offsetDateTimeNoFractionParse () {
90
+ JSON json = new JSON ();
77
91
String timeStr = "\" 2018-04-03T11:32:26Z\" " ;
78
92
OffsetDateTime dateTime = json .deserialize (timeStr , OffsetDateTime .class );
79
93
String serializedTsStr = json .serialize (dateTime );
0 commit comments