TeamInfo implements Serializable { public Object lookUp() { if (!name.isEmpty()) { BitbucketClient bitbucketClient = getBitbucketClient(); team = bitbucketClient.getTeamAccount(name); if (!isFound()) { FacesContext facesContext = FacesContext.getCurrentInstance(); UIComponent c = UIComponent.getCurrentComponent(facesContext); facesContext.addMessage(c.getClientId(facesContext), new FacesMessage("Team not found.")); } } else { team = null; } return null; } @Inject  TeamInfo(final SessionUser sessionUser); SessionUser getSessionUser(); String getName(); void setName(final String value); BitbucketAccount getTeam(); boolean isFound(); Object lookUp();  }
@Disabled("Faces runtime is required") @Test void testLookUp() { TeamInfo teamInfo = new TeamInfo(sessionUser); Object outcome; teamInfo.setName(""); outcome = teamInfo.lookUp(); assertNull(outcome); assertNull(teamInfo.getTeam()); assertEquals(false, teamInfo.isFound()); teamInfo.setName("vx68k"); outcome = teamInfo.lookUp(); assertNull(outcome); assertNotNull(teamInfo.getTeam()); assertEquals(true, teamInfo.isFound()); assertEquals("kazssym", teamInfo.getTeam().getUsername()); }