@@ -31,6 +31,7 @@ public void parse() throws JSONException {
3131 "size: 4242," +
3232 "mandatory_update: false," +
3333 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
34+ "fileExtension: 'apk'," +
3435 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
3536 "}" ;
3637 ReleaseDetails releaseDetails = ReleaseDetails .parse (json );
@@ -46,6 +47,7 @@ public void parse() throws JSONException {
4647 assertFalse (releaseDetails .isMandatoryUpdate ());
4748 assertEquals ("9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60" , releaseDetails .getReleaseHash ());
4849 assertEquals ("fd37a4b1-4937-45ef-97fb-b864154371f0" , releaseDetails .getDistributionGroupId ());
50+ assertEquals (FileExtension .apk , releaseDetails .getFileExtension ());
4951 }
5052
5153 @ Test (expected = JSONException .class )
@@ -59,6 +61,7 @@ public void missingId() throws JSONException {
5961 "size: 4242," +
6062 "mandatory_update: false," +
6163 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
64+ "fileExtension: 'apk'," +
6265 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
6366 "}" ;
6467 ReleaseDetails .parse (json );
@@ -76,6 +79,7 @@ public void invalidId() throws JSONException {
7679 "size: 4242," +
7780 "mandatory_update: false," +
7881 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
82+ "fileExtension: 'apk'," +
7983 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
8084 "}" ;
8185 ReleaseDetails .parse (json );
@@ -93,6 +97,7 @@ public void acceptIdAsString() throws JSONException {
9397 "size: 4242," +
9498 "mandatory_update: false," +
9599 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
100+ "fileExtension: 'apk'," +
96101 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
97102 "}" ;
98103 ReleaseDetails releaseDetails = ReleaseDetails .parse (json );
@@ -119,6 +124,7 @@ public void missingVersion() throws JSONException {
119124 "size: 4242," +
120125 "mandatory_update: false," +
121126 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
127+ "fileExtension: 'apk'," +
122128 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
123129 "}" ;
124130 ReleaseDetails .parse (json );
@@ -136,6 +142,7 @@ public void invalidVersion() throws JSONException {
136142 "size: 4242," +
137143 "mandatory_update: false," +
138144 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
145+ "fileExtension: 'apk'," +
139146 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
140147 "}" ;
141148 ReleaseDetails .parse (json );
@@ -152,6 +159,7 @@ public void missingShortVersion() throws JSONException {
152159 "size: 4242," +
153160 "mandatory_update: false," +
154161 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
162+ "fileExtension: 'apk'," +
155163 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
156164 "}" ;
157165 ReleaseDetails .parse (json );
@@ -168,6 +176,7 @@ public void missingReleaseNotes() throws JSONException {
168176 "size: 4242," +
169177 "mandatory_update: false," +
170178 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
179+ "fileExtension: 'apk'," +
171180 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
172181 "}" ;
173182 ReleaseDetails releaseDetails = ReleaseDetails .parse (json );
@@ -195,6 +204,7 @@ public void nullReleaseNotes() throws JSONException {
195204 "size: 4242," +
196205 "mandatory_update: false," +
197206 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
207+ "fileExtension: 'apk'," +
198208 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
199209 "}" ;
200210 ReleaseDetails releaseDetails = ReleaseDetails .parse (json );
@@ -224,6 +234,7 @@ public void nullReleaseNotesUrl() throws JSONException {
224234 "size: 4242," +
225235 "mandatory_update: false," +
226236 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
237+ "fileExtension: 'apk'," +
227238 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
228239 "}" ;
229240 ReleaseDetails releaseDetails = ReleaseDetails .parse (json );
@@ -250,6 +261,7 @@ public void missingApiLevel() throws JSONException {
250261 "size: 4242," +
251262 "mandatory_update: false," +
252263 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
264+ "fileExtension: 'apk'," +
253265 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
254266 "}" ;
255267 ReleaseDetails .parse (json );
@@ -267,6 +279,7 @@ public void acceptApiLevelAsString() throws JSONException {
267279 "size: 4242," +
268280 "mandatory_update: false," +
269281 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
282+ "fileExtension: 'apk'," +
270283 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
271284 "}" ;
272285 ReleaseDetails releaseDetails = ReleaseDetails .parse (json );
@@ -294,6 +307,7 @@ public void invalidApiLevel() throws JSONException {
294307 "size: 4242," +
295308 "mandatory_update: false," +
296309 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
310+ "fileExtension: 'apk'," +
297311 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
298312 "}" ;
299313 ReleaseDetails .parse (json );
@@ -310,6 +324,7 @@ public void missingDownloadUrl() throws JSONException {
310324 "size: 4242," +
311325 "mandatory_update: false," +
312326 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
327+ "fileExtension: 'apk'," +
313328 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
314329 "}" ;
315330 ReleaseDetails .parse (json );
@@ -327,6 +342,7 @@ public void missingDownloadUrlScheme() throws JSONException {
327342 "size: 4242," +
328343 "mandatory_update: false," +
329344 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
345+ "fileExtension: 'apk'," +
330346 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
331347 "}" ;
332348 ReleaseDetails .parse (json );
@@ -344,6 +360,7 @@ public void invalidDownloadUrlScheme() throws JSONException {
344360 "size: 4242," +
345361 "mandatory_update: false," +
346362 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
363+ "fileExtension: 'apk'," +
347364 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
348365 "}" ;
349366 ReleaseDetails .parse (json );
@@ -360,6 +377,7 @@ public void missingSize() throws JSONException {
360377 "download_url: 'http://download.thinkbroadband.com/1GB.zip'," +
361378 "mandatory_update: false," +
362379 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
380+ "fileExtension: 'apk'," +
363381 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
364382 "}" ;
365383 ReleaseDetails .parse (json );
@@ -377,6 +395,7 @@ public void mandatoryUpdate() throws JSONException {
377395 "size: 4242," +
378396 "mandatory_update: true," +
379397 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
398+ "fileExtension: 'apk'," +
380399 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
381400 "}" ;
382401 ReleaseDetails releaseDetails = ReleaseDetails .parse (json );
@@ -403,6 +422,7 @@ public void missingMandatoryUpdate() throws JSONException {
403422 "size: 4242," +
404423 "download_url: 'http://download.thinkbroadband.com/1GB.zip'," +
405424 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']," +
425+ "fileExtension: 'apk'," +
406426 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
407427 "}" ;
408428 ReleaseDetails .parse (json );
@@ -436,6 +456,7 @@ public void emptyPackageHashes() throws JSONException {
436456 "size: 4242," +
437457 "mandatory_update: false," +
438458 "package_hashes: []," +
459+ "fileExtension: 'apk'," +
439460 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
440461 "}" ;
441462 ReleaseDetails .parse (json );
@@ -453,6 +474,7 @@ public void invalidPackageHashes() throws JSONException {
453474 "size: 4242," +
454475 "mandatory_update: false," +
455476 "package_hashes: '9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60'" +
477+ "fileExtension: 'apk'," +
456478 "distribution_group_id: 'fd37a4b1-4937-45ef-97fb-b864154371f0'" +
457479 "}" ;
458480 ReleaseDetails .parse (json );
@@ -470,6 +492,7 @@ public void nullDistributionGroupId() throws JSONException {
470492 "download_url: 'http://download.thinkbroadband.com/1GB.zip'," +
471493 "size: 4242," +
472494 "mandatory_update: false," +
495+ "fileExtension: 'apk'," +
473496 "package_hashes: ['9f52199c986d9210842824df695900e1656180946212bd5e8978501a5b732e60']" +
474497 "}" ;
475498 ReleaseDetails releaseDetails = ReleaseDetails .parse (json );
0 commit comments