Rename function so tests pass

This commit is contained in:
Chris Eykamp 2017-10-03 17:31:15 -07:00
parent 96c9dbd698
commit 1bf0437756
4 changed files with 5 additions and 5 deletions

View File

@ -56,7 +56,7 @@ public class CustomerController extends BaseController {
ObjectMapper objectMapper = new ObjectMapper();
ObjectNode infoObject = objectMapper.createObjectNode();
infoObject.put("title", customer.getTitle());
infoObject.put("isPublic", customer.isPublic());
infoObject.put("isPublic", customer.publicCustomer());
return infoObject;
} catch (Exception e) {
throw handleException(e);

View File

@ -104,7 +104,7 @@ public class RefreshTokenAuthenticationProvider implements AuthenticationProvide
throw new UsernameNotFoundException("Public entity not found by refresh token");
}
if (!publicCustomer.isPublic()) {
if (!publicCustomer.publicCustomer()) {
throw new BadCredentialsException("Refresh token is not valid");
}

View File

@ -108,7 +108,7 @@ public class RestAuthenticationProvider implements AuthenticationProvider {
if (publicCustomer == null) {
throw new UsernameNotFoundException("Public entity not found: " + publicId);
}
if (!publicCustomer.isPublic()) {
if (!publicCustomer.publicCustomer()) {
throw new BadCredentialsException("Authentication Failed. Public Id is not valid.");
}
User user = new User(new UserId(UUIDBased.EMPTY));

View File

@ -61,7 +61,7 @@ public class Customer extends ContactBased<CustomerId> implements HasName {
this.title = title;
}
public boolean isPublic() {
public boolean publicCustomer() { // Using better name isPublic causes tests to fail
if (getAdditionalInfo() != null && getAdditionalInfo().has("isPublic")) {
return getAdditionalInfo().get("isPublic").asBoolean();
}