@Test
public void failWhenProgramHasNoOrgUnitMatchingEventOrgUnit()
{

    // assign a UID to the event's org unit
    event.setOrgUnit( CodeGenerator.generateUid() );
    // Prepare data
    Program program = createProgram( 'P' );
    // make sure that one of the generate Org Units, has the event's UID
    program.setOrganisationUnits( create( 5, CodeGenerator.generateUid(), IdScheme.UID ) );
    ProgramInstance pi = new ProgramInstance();
    pi.setProgram( program );
    Map<String, ProgramInstance> programInstanceMap = new HashMap<>();
    programInstanceMap.put( event.getUid(), pi );
    when( workContext.getProgramInstanceMap() ).thenReturn( programInstanceMap );
    // method under test
    ImportSummary summary = rule.check( new ImmutableEvent( event ), workContext );
    assertHasError( summary, event, "Program is not assigned to this Organisation Unit: " + event.getOrgUnit() );
}