@Test public void shouldSetLoginInformationFields() { when(user.getUserName()).thenReturn("username"); when(user.getFirstName()).thenReturn("first"); when(user.getLastName()).thenReturn("last"); when(facility.getCode()).thenReturn("code"); when(facility.getName()).thenReturn("name"); LoginInformation loginInformation = LoginInformation.prepareForREST(user, facility); assertEquals("username", loginInformation.getUserName()); assertEquals("first", loginInformation.getUserFirstName()); assertEquals("last", loginInformation.getUserLastName()); assertEquals("code", loginInformation.getFacilityCode()); assertEquals("name", loginInformation.getFacilityName()); }
public static LoginInformation prepareForREST(final User user, final Facility facility) { LoginInformation loginInformation = new LoginInformation(); loginInformation.setUserFirstName(user.getFirstName()); loginInformation.setUserLastName(user.getLastName()); loginInformation.setUserName(user.getUserName()); if (facility != null) { loginInformation.setFacilityId(facility.getId()); loginInformation.setFacilityCode(facility.getCode()); loginInformation.setFacilityName(facility.getName()); } else { loginInformation.setFacilityId(null); loginInformation.setFacilityCode(null); loginInformation.setFacilityName(null); } return loginInformation; }
LoginInformation { public static LoginInformation prepareForREST(final User user, final Facility facility) { LoginInformation loginInformation = new LoginInformation(); loginInformation.setUserFirstName(user.getFirstName()); loginInformation.setUserLastName(user.getLastName()); loginInformation.setUserName(user.getUserName()); if (facility != null) { loginInformation.setFacilityId(facility.getId()); loginInformation.setFacilityCode(facility.getCode()); loginInformation.setFacilityName(facility.getName()); } else { loginInformation.setFacilityId(null); loginInformation.setFacilityCode(null); loginInformation.setFacilityName(null); } return loginInformation; } }
LoginInformation { public static LoginInformation prepareForREST(final User user, final Facility facility) { LoginInformation loginInformation = new LoginInformation(); loginInformation.setUserFirstName(user.getFirstName()); loginInformation.setUserLastName(user.getLastName()); loginInformation.setUserName(user.getUserName()); if (facility != null) { loginInformation.setFacilityId(facility.getId()); loginInformation.setFacilityCode(facility.getCode()); loginInformation.setFacilityName(facility.getName()); } else { loginInformation.setFacilityId(null); loginInformation.setFacilityCode(null); loginInformation.setFacilityName(null); } return loginInformation; }  }
LoginInformation { public static LoginInformation prepareForREST(final User user, final Facility facility) { LoginInformation loginInformation = new LoginInformation(); loginInformation.setUserFirstName(user.getFirstName()); loginInformation.setUserLastName(user.getLastName()); loginInformation.setUserName(user.getUserName()); if (facility != null) { loginInformation.setFacilityId(facility.getId()); loginInformation.setFacilityCode(facility.getCode()); loginInformation.setFacilityName(facility.getName()); } else { loginInformation.setFacilityId(null); loginInformation.setFacilityCode(null); loginInformation.setFacilityName(null); } return loginInformation; }  static LoginInformation prepareForREST(final User user, final Facility facility); }
LoginInformation { public static LoginInformation prepareForREST(final User user, final Facility facility) { LoginInformation loginInformation = new LoginInformation(); loginInformation.setUserFirstName(user.getFirstName()); loginInformation.setUserLastName(user.getLastName()); loginInformation.setUserName(user.getUserName()); if (facility != null) { loginInformation.setFacilityId(facility.getId()); loginInformation.setFacilityCode(facility.getCode()); loginInformation.setFacilityName(facility.getName()); } else { loginInformation.setFacilityId(null); loginInformation.setFacilityCode(null); loginInformation.setFacilityName(null); } return loginInformation; }  static LoginInformation prepareForREST(final User user, final Facility facility);  }