The issue was in integration tests, where the oauthClient created in keycloak did not have 'claim' on the username, resulting in 'null' username in the code.