@Test
public void failOnDeletedProgramStageInstance()
{

    Map<String, ProgramStageInstance> programStageInstanceMap = new HashMap<>();
    ProgramStageInstance psi = new ProgramStageInstance();
    psi.setDeleted( true );
    programStageInstanceMap.put( event.getEvent(), psi );
    when( workContext.getProgramStageInstanceMap() ).thenReturn( programStageInstanceMap );
    ImportSummary summary = rule.check( new ImmutableEvent( event ), workContext );
    assertHasError( summary, event,
        "Event ID " + event.getEvent() + " was already used and/or deleted. This event can not be modified." );
}