@@ -320,6 +320,11 @@ public void testSerializeWithMap() throws Exception
320320 js1 ._cachedObjects .put ("cachedString" , "foo" );
321321 js1 ._cachedObjects .put ("cachedLong" , 2L );
322322
323+ LongHashMap <Long > longMap = new LongHashMap <>();
324+ longMap .put (1L , 2L );
325+
326+ js1 ._cachedObjects .put ("cachedLongMap" , longMap );
327+
323328 ObjectMapper mapper = PipelineJob .createObjectMapper ();
324329
325330 StringWriter writer = new StringWriter ();
@@ -341,10 +346,13 @@ public void testSerializeWithMap() throws Exception
341346 //NOTE: this is not serializing properly. the keys are serialized as Strings
342347 Map serializedMap = deserialized .getCachedObject ("cachedMap" , mapper .getTypeFactory ().constructParametricType (Map .class , Integer .class , Integer .class ));
343348 assertEquals ("Map not serialized properly" , 1 , serializedMap .size ());
344-
345- //TODO: determine if we can coax jackson into serializing these properly
346349 assertEquals ("Object not serialized with correct key type" , Integer .class , serializedMap .keySet ().iterator ().next ().getClass ());
347350 assertNotNull ("Map keys not serialized properly" , serializedMap .get (1 ));
351+
352+ LongHashMap <Long > serializedLongMap = (LongHashMap <Long >)deserialized .getCachedObject ("cachedLongMap" , LongHashMap .class );
353+ assertEquals ("LongMap not serialized properly" , 1 , serializedLongMap .size ());
354+ assertEquals ("Object not serialized with correct key type" , Long .class , serializedLongMap .keySet ().iterator ().next ().getClass ());
355+ assertNotNull ("LongMap keys not serialized properly" , serializedLongMap .get (1L ));
348356 }
349357
350358 @ Test
0 commit comments