@Test
public void failOnNoProgramInstanceByActiveProgramAndTei()
{

    // Data preparation
    //
    // Program Instance
    //
    when( workContext.getProgramInstanceMap() ).thenReturn( new HashMap<>() );
    //
    // Tracked Entity Instance
    //
    TrackedEntityInstance tei = createTrackedEntityInstance( createOrganisationUnit( 'A' ) );
    when( workContext.getTrackedEntityInstance( event.getUid() ) ).thenReturn( Optional.of( tei ) );
    event.setProgram( program.getUid() );
    //
    // Method under test
    //
    ImportSummary summary = rule.check( new ImmutableEvent( event ), workContext );
    assertHasError( summary, event,
        "Tracked entity instance: " + tei.getUid() + " is not enrolled in program: " + program.getUid() );
}