@@ -303,4 +303,61 @@ public void testParseRemoteRuntimeJson_AdoptIsConvertedToEclipse() {
303
303
assertEquals (1 , result .getRuntimes ().size ());
304
304
assertEquals (result .getRuntimes ().get (0 ).getVendor (), ECLIPSE );
305
305
}
306
+
307
+ @ Test
308
+ public void testParseRemoteRuntimeJson_BrokenVendor () {
309
+ // given
310
+ final String json = "{\n " +
311
+ " \" cacheTimeInMillis\" :5000,\n " +
312
+ " \" runtimes\" :\n " +
313
+ " [\n " +
314
+ " {\n " +
315
+ " \" version\" :\" 8.0.282\" ,\n " +
316
+ " \" vendor\" :\" AdoptOpenJDK\" ,\n " +
317
+ " \" os\" :\" BROKEN\" ,\n " +
318
+ " \" href\" :\" " + THE_ONE_AND_ONLY_JDK_ZIP + "\" \n " +
319
+ " }\n " +
320
+ " ]\n " +
321
+ "}\n " +
322
+ "\n " ;
323
+
324
+ // when
325
+ RemoteRuntimeList result = RemoteRuntimeManager .getInstance ().parseRemoteRuntimeJson (json );
326
+
327
+ // then
328
+ assertEquals (0 , result .getRuntimes ().size ());
329
+ }
330
+
331
+ @ Test
332
+ public void testParseRemoteRuntimeJson_1_6 () {
333
+ // given
334
+ final String json = "{\n " +
335
+ " \" cacheTimeInMillis\" :5000,\n " +
336
+ " \" runtimes\" :\n " +
337
+ " [\n " +
338
+ " {\n " +
339
+ " \" version\" :\" 8.0.282\" ,\n " +
340
+ " \" vendor\" :\" AdoptOpenJDK\" ,\n " +
341
+ " \" os\" :\" WIN64\" ,\n " +
342
+ " \" href\" :\" " + THE_ONE_AND_ONLY_JDK_ZIP + "\" \n " +
343
+ " }\n " +
344
+ " ],\n " +
345
+ " \" runtimes_1.6\" :\n " +
346
+ " [\n " +
347
+ " {\n " +
348
+ " \" version\" :\" 8.0.282\" ,\n " +
349
+ " \" vendor\" :\" AdoptOpenJDK\" ,\n " +
350
+ " \" os\" :\" MACARM64\" ,\n " +
351
+ " \" href\" :\" " + THE_ONE_AND_ONLY_JDK_ZIP + "\" \n " +
352
+ " }\n " +
353
+ " ]\n " +
354
+ "}\n " +
355
+ "\n " ;
356
+
357
+ // when
358
+ RemoteRuntimeList result = RemoteRuntimeManager .getInstance ().parseRemoteRuntimeJson (json );
359
+
360
+ // then
361
+ assertEquals (2 , result .getRuntimes ().size ());
362
+ }
306
363
}
0 commit comments