@@ -46,22 +46,26 @@ public void allAttributesAreSerialized() throws Exception {
4646 }
4747
4848 @ Test
49- public void contextKeysAreSetInsteadOfContextWhenNotInlined () throws Exception {
50- testContextKeysSerialization (
49+ public void contextIsAlwaysInlined () throws Exception {
50+ testContextSerialization (
5151 LDContext .create ("userkey" ),
52- LDValue .buildObject ().put ("user" , "userkey" ).build ()
52+ LDValue .buildObject ().put ("kind" , " user" ). put ( "key " , "userkey" ).build ()
5353 );
5454
55- testContextKeysSerialization (
55+ testContextSerialization (
5656 LDContext .create (ContextKind .of ("kind1" ), "key1" ),
57- LDValue .buildObject ().put ("kind1" , "key1" ).build ()
57+ LDValue .buildObject ().put ("kind" , " kind1" ). put ( "key " , "key1" ).build ()
5858 );
5959
60- testContextKeysSerialization (
60+ testContextSerialization (
6161 LDContext .createMulti (
6262 LDContext .create (ContextKind .of ("kind1" ), "key1" ),
6363 LDContext .create (ContextKind .of ("kind2" ), "key2" )),
64- LDValue .buildObject ().put ("kind1" , "key1" ).put ("kind2" , "key2" ).build ()
64+ LDValue .buildObject ()
65+ .put ("kind" , "multi" )
66+ .put ("kind1" , LDValue .buildObject ().put ("key" , "key1" ).build ())
67+ .put ("kind2" , LDValue .buildObject ().put ("key" , "key2" ).build ())
68+ .build ()
6569 );
6670 }
6771
@@ -709,14 +713,14 @@ private LDValue getSingleOutputEvent(EventOutputFormatter f, Event event) throws
709713 return parseValue (w .toString ()).get (0 );
710714 }
711715
712- private void testContextKeysSerialization (LDContext context , LDValue expectedJsonValue ) throws IOException {
716+ private void testContextSerialization (LDContext context , LDValue expectedJsonValue ) throws IOException {
713717 EventsConfiguration config = makeEventsConfig (false , null );
714718 EventOutputFormatter f = new EventOutputFormatter (config );
715719
716720 Event .Custom customEvent = customEvent (context , "eventkey" ).build ();
717721 LDValue outputEvent = getSingleOutputEvent (f , customEvent );
718- assertJsonEquals (expectedJsonValue , outputEvent .get ("contextKeys " ));
719- assertJsonEquals (LDValue .ofNull (), outputEvent .get ("context " ));
722+ assertJsonEquals (expectedJsonValue , outputEvent .get ("context " ));
723+ assertJsonEquals (LDValue .ofNull (), outputEvent .get ("contextKeys " ));
720724 }
721725
722726 private void testInlineContextSerialization (LDContext context , LDValue expectedJsonValue , EventsConfiguration baseConfig ) throws IOException {
0 commit comments