@Test public void encounterFromParam_shouldReturnNullForAuthenticationException() { Context.getUserContext().logout(); Assert.assertThat(configurator.encounterFromParam("3"), nullValue()); }
protected Encounter encounterFromParam(String id) { if (StringUtils.isEmpty(id)) { return null; } try { return encounterService.getEncounter(Integer.valueOf(id)); } catch (APIAuthenticationException ex) { return null; } }
EmrModelConfigurator implements PageModelConfigurator, FragmentModelConfigurator { protected Encounter encounterFromParam(String id) { if (StringUtils.isEmpty(id)) { return null; } try { return encounterService.getEncounter(Integer.valueOf(id)); } catch (APIAuthenticationException ex) { return null; } } }
EmrModelConfigurator implements PageModelConfigurator, FragmentModelConfigurator { protected Encounter encounterFromParam(String id) { if (StringUtils.isEmpty(id)) { return null; } try { return encounterService.getEncounter(Integer.valueOf(id)); } catch (APIAuthenticationException ex) { return null; } }  }
EmrModelConfigurator implements PageModelConfigurator, FragmentModelConfigurator { protected Encounter encounterFromParam(String id) { if (StringUtils.isEmpty(id)) { return null; } try { return encounterService.getEncounter(Integer.valueOf(id)); } catch (APIAuthenticationException ex) { return null; } }  @Override void configureModel(PageContext pageContext); @Override void configureModel(FragmentContext fragmentContext); }
EmrModelConfigurator implements PageModelConfigurator, FragmentModelConfigurator { protected Encounter encounterFromParam(String id) { if (StringUtils.isEmpty(id)) { return null; } try { return encounterService.getEncounter(Integer.valueOf(id)); } catch (APIAuthenticationException ex) { return null; } }  @Override void configureModel(PageContext pageContext); @Override void configureModel(FragmentContext fragmentContext);  }