TrackerSideEffectDataBundle implements Message { @Override @JsonProperty public MessageType getMessageType() { return MessageType.TRACKER_SIDE_EFFECT; }  @Override @JsonProperty MessageType getMessageType();  }
@Test public void testSideEffectDataBundleForEnrollment() { Enrollment enrollment = new Enrollment(); enrollment.setEnrollment( "test-enrollment" ); Map<String, List<TrackerRuleEngineSideEffect>> enrollmentRuleEffects = new HashMap<>(); enrollmentRuleEffects.put( enrollment.getEnrollment(), Lists.newArrayList() ); ProgramInstance programInstance = new ProgramInstance(); programInstance.setAutoFields(); TrackerSideEffectDataBundle bundle = TrackerSideEffectDataBundle.builder() .enrollmentRuleEffects( enrollmentRuleEffects ) .accessedBy( "testUser" ) .importStrategy( TrackerImportStrategy.CREATE ) .object( programInstance.getUid() ) .klass( ProgramInstance.class ) .build(); assertEquals( programInstance.getUid(), bundle.getObject() ); assertEquals( ProgramInstance.class, bundle.getKlass() ); assertTrue( bundle.getEnrollmentRuleEffects().containsKey( "test-enrollment" ) ); assertTrue( bundle.getEventRuleEffects().isEmpty() ); assertEquals( TrackerImportStrategy.CREATE, bundle.getImportStrategy() ); assertEquals( MessageType.TRACKER_SIDE_EFFECT, bundle.getMessageType() ); }