DbCredential { public boolean isHealthy() { return user != null && password != null; }  void setDataModelVersion(final String newVersion); String getDataModelVersion(); String getUser(); void setUser(final String user); String getPassword(); void setPassword(final String password); List<AvailableRoles> getRoles(); void setRoles(final List<AvailableRoles> roles); void addRole(final AvailableRoles role); void removeRole(final AvailableRoles role); boolean isHealthy(); static AvailableRoles getRole(final String roleParam); static final String DATA_MODEL_VERSION; static final String PASSWORD_FIELD; static final String ROLES_FIELD; }
@Test public void isHealthy(){ DbCredential credential = new DbCredential(); assertFalse(credential.isHealthy()); credential.setUser("test"); assertFalse(credential.isHealthy()); credential.setPassword("test"); assertTrue(credential.isHealthy()); }