@@ -265,15 +265,15 @@ public void identifyEventIsSerialized() throws IOException {
265265 @ Test
266266 public void customEventIsSerialized () throws IOException {
267267 LDContext context = LDContext .builder ("userkey" ).name ("me" ).build ();
268- LDValue contextKeysJson = LDValue .buildObject ().put ("user " , context . getKey () ).build ();
268+ LDValue contextJson = LDValue .buildObject ().put ("kind " , "user" ). put ( "key" , "userkey" ). put ( "name" , "me" ).build ();
269269 EventOutputFormatter f = new EventOutputFormatter (defaultEventsConfig ());
270270
271271 Event .Custom ceWithoutData = customEvent (context , "customkey" ).build ();
272272 LDValue ceJson1 = parseValue ("{" +
273273 "\" kind\" :\" custom\" ," +
274274 "\" creationDate\" :100000," +
275275 "\" key\" :\" customkey\" ," +
276- "\" contextKeys \" :" + contextKeysJson +
276+ "\" context \" :" + contextJson +
277277 "}" );
278278 assertJsonEquals (ceJson1 , getSingleOutputEvent (f , ceWithoutData ));
279279
@@ -282,7 +282,7 @@ public void customEventIsSerialized() throws IOException {
282282 "\" kind\" :\" custom\" ," +
283283 "\" creationDate\" :100000," +
284284 "\" key\" :\" customkey\" ," +
285- "\" contextKeys \" :" + contextKeysJson + "," +
285+ "\" context \" :" + contextJson + "," +
286286 "\" data\" :\" thing\" " +
287287 "}" );
288288 assertJsonEquals (ceJson2 , getSingleOutputEvent (f , ceWithData ));
@@ -292,7 +292,7 @@ public void customEventIsSerialized() throws IOException {
292292 "\" kind\" :\" custom\" ," +
293293 "\" creationDate\" :100000," +
294294 "\" key\" :\" customkey\" ," +
295- "\" contextKeys \" :" + contextKeysJson + "," +
295+ "\" context \" :" + contextJson + "," +
296296 "\" metricValue\" :2.5" +
297297 "}" );
298298 assertJsonEquals (ceJson3 , getSingleOutputEvent (f , ceWithMetric ));
@@ -303,7 +303,7 @@ public void customEventIsSerialized() throws IOException {
303303 "\" kind\" :\" custom\" ," +
304304 "\" creationDate\" :100000," +
305305 "\" key\" :\" customkey\" ," +
306- "\" contextKeys \" :" + contextKeysJson + "," +
306+ "\" context \" :" + contextJson + "," +
307307 "\" data\" :\" thing\" ," +
308308 "\" metricValue\" :2.5" +
309309 "}" );
@@ -408,8 +408,10 @@ public void migrationOpEventIsSerialized() throws IOException {
408408 .put ("reason" , LDValue .buildObject ()
409409 .put ("kind" , "FALLTHROUGH" )
410410 .build ()).build ())
411- .put ("contextKeys" , LDValue .buildObject ()
412- .put ("user" , "user-key" )
411+ .put ("context" , LDValue .buildObject ()
412+ .put ("kind" , "user" )
413+ .put ("key" , "user-key" )
414+ .put ("name" , "me" )
413415 .build ())
414416 .put ("samplingRatio" , 2 )
415417 .put ("measurements" , LDValue .buildArray ()
@@ -495,8 +497,10 @@ public void migrationOpEventSerializationCanExcludeOptionalItems() throws IOExce
495497 .put ("reason" , LDValue .buildObject ()
496498 .put ("kind" , "FALLTHROUGH" )
497499 .build ()).build ())
498- .put ("contextKeys" , LDValue .buildObject ()
499- .put ("user" , "user-key" )
500+ .put ("context" , LDValue .buildObject ()
501+ .put ("kind" , "user" )
502+ .put ("key" , "user-key" )
503+ .put ("name" , "me" )
500504 .build ())
501505 .put ("measurements" , LDValue .buildArray ()
502506 .add (LDValue .buildObject ()
0 commit comments