@@ -42,7 +42,16 @@ public void setUp() {
42
42
43
43
@ Test
44
44
public void testReportToJsonAndBack_equals () throws IOException {
45
- final CrashlyticsReport testReport = makeTestReport ();
45
+ final CrashlyticsReport testReport = makeTestReport (false );
46
+ final String testReportJson = transform .reportToJson (testReport );
47
+ final CrashlyticsReport reifiedReport = transform .reportFromJson (testReportJson );
48
+ assertNotSame (reifiedReport , testReport );
49
+ assertEquals (reifiedReport , testReport );
50
+ }
51
+
52
+ @ Test
53
+ public void testReportToJsonAndBack_with_developmentPlatform_equals () throws IOException {
54
+ final CrashlyticsReport testReport = makeTestReport (true );
46
55
final String testReportJson = transform .reportToJson (testReport );
47
56
final CrashlyticsReport reifiedReport = transform .reportFromJson (testReportJson );
48
57
assertNotSame (reifiedReport , testReport );
@@ -58,37 +67,43 @@ public void testEventToJsonAndBack_equals() throws IOException {
58
67
assertEquals (reifiedEvent , testEvent );
59
68
}
60
69
61
- private static CrashlyticsReport makeTestReport () {
70
+ private static CrashlyticsReport makeTestReport (boolean useDevelopmentPlatform ) {
62
71
return CrashlyticsReport .builder ()
63
72
.setSdkVersion ("sdkVersion" )
64
73
.setGmpAppId ("gmpAppId" )
65
74
.setPlatform (1 )
66
75
.setInstallationUuid ("installationId" )
67
76
.setBuildVersion ("1" )
68
77
.setDisplayVersion ("1.0.0" )
69
- .setSession (makeTestSession ())
78
+ .setSession (makeTestSession (useDevelopmentPlatform ))
70
79
.build ();
71
80
}
72
81
73
- private static CrashlyticsReport .Session makeTestSession () {
82
+ private static CrashlyticsReport .Session makeTestSession (boolean useDevelopmentPlatform ) {
74
83
return Session .builder ()
75
84
.setGenerator ("generator" )
76
85
.setIdentifier ("identifier" )
77
86
.setStartedAt (1L )
78
87
.setEndedAt (1L )
79
88
.setCrashed (true )
80
- .setApp (makeTestApplication ())
89
+ .setApp (makeTestApplication (useDevelopmentPlatform ))
81
90
.setUser (User .builder ().setIdentifier ("user" ).build ())
82
91
.setGeneratorType (3 )
83
92
.build ();
84
93
}
85
94
86
- private static Application makeTestApplication () {
87
- return Application .builder ()
88
- .setIdentifier ("applicationId" )
89
- .setVersion ("version" )
90
- .setDisplayVersion ("displayVersion" )
91
- .build ();
95
+ private static Application makeTestApplication (boolean useDevelopmentPlatform ) {
96
+ final Application .Builder builder =
97
+ Application .builder ()
98
+ .setIdentifier ("applicationId" )
99
+ .setVersion ("version" )
100
+ .setDisplayVersion ("displayVersion" );
101
+ if (useDevelopmentPlatform ) {
102
+ builder
103
+ .setDevelopmentPlatform ("developmentPlatform" )
104
+ .setDevelopmentPlatformVersion ("developmentPlatformVersion" );
105
+ }
106
+ return builder .build ();
92
107
}
93
108
94
109
private static ImmutableList <Event > makeTestEvents (int numEvents ) {
0 commit comments