void () { EventLogGroup group = new EventLogGroup("newGroup", 1); StringEventField nameField = EventFields.StringValidatedByEnum("name", "os"); IntEventField notRegisteredField = EventFields.Int("not_registered"); EventId1<ObjectEventData> event = group.registerEvent("testEvent", new ObjectEventField("obj", nameField)); FUCollectorTestCase.INSTANCE.collectLogEvents(getTestRootDisposable(), () -> { assertThrows(IllegalArgumentException.class, "Field not_registered is not in allowed object fields", () -> event.log(new ObjectEventData(nameField.with("testName"), notRegisteredField.with(1)))); return Unit.INSTANCE; }); }