/** * Perform a test of serialization/deserialization with specific inputs. * @param signedChunkIds the list of signed chunk IDs to test with. */ private void doSerDeTest(List<String> signedChunkIds) { JSONObject stitchRequestJson = StitchRequestSerDe.toJson(signedChunkIds); assertEquals("Unexpected deserialized signed chunk IDs", signedChunkIds == null ? Collections.emptyList() : signedChunkIds, StitchRequestSerDe.fromJson(stitchRequestJson)); } }
/** * Test {@link StitchRequestSerDe}'s serialization/deserialization methods. * @throws Exception */ @Test public void serDeTest() { doSerDeTest(null); doSerDeTest(Collections.emptyList()); doSerDeTest(Arrays.asList("a", "b", "/signedId/abcdef")); }