Rename function so tests pass
This commit is contained in:
		
							parent
							
								
									96c9dbd698
								
							
						
					
					
						commit
						1bf0437756
					
				@ -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);
 | 
			
		||||
 | 
			
		||||
@ -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");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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));
 | 
			
		||||
 | 
			
		||||
@ -60,8 +60,8 @@ public class Customer extends ContactBased<CustomerId> implements HasName {
 | 
			
		||||
    public void setTitle(String title) {
 | 
			
		||||
        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();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user