test_class.file: mirrorgate-api/src/test/java/com/bbva/arq/devops/ae/mirrorgate/security/TokenCreatorTest.java
test_class.identifier: TokenCreatorTest
test_case.body: @Test
      public void testRegularUser() {
          final MirrorgateAuthenticationToken token = TokenCreator.createHeaderBasedToken("ANONYMOUS");
          final SimpleGrantedAuthority expectedAuthority = new SimpleGrantedAuthority(
              SecurityAuthoritiesEnum.SCREEN.toString()
          );
  
          assertTrue(token.getCredentials().contains(expectedAuthority));
      }
test_case.class_method_signature: TokenCreatorTest.testRegularUser()
test_case.full_signature: @Test public void testRegularUser()
test_case.identifier: testRegularUser
test_case.invocations: createHeaderBasedToken toString assertTrue contains getCredentials
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRegularUser()
focal_class.declarator: LOG = LoggerFactory.getLogger(TokenCreator.class.getName())
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(TokenCreator.class.getName());
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.file: mirrorgate-api/src/main/java/com/bbva/arq/devops/ae/mirrorgate/security/TokenCreator.java
focal_class.identifier: TokenCreator
focal_class.class_method_signature: TokenCreator.TokenCreator()
focal_class.full_signature: private  TokenCreator()
focal_class.identifier: TokenCreator
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  TokenCreator()
focal_class.class_method_signature: TokenCreator.createHeaderBasedToken(final String headerValue)
focal_class.full_signature: public static MirrorgateAuthenticationToken createHeaderBasedToken(final String headerValue)
focal_class.identifier: createHeaderBasedToken
focal_class.modifiers: public static
focal_class.parameters: (final String headerValue)
focal_class.return: MirrorgateAuthenticationToken
focal_class.signature: MirrorgateAuthenticationToken createHeaderBasedToken(final String headerValue)
focal_method.body: public static MirrorgateAuthenticationToken createHeaderBasedToken(final String headerValue) {
  
          GrantedAuthority authority;
  
          // We keep empty header for back compatibility
          if (StringUtils.isEmpty(headerValue) || headerValue.contains("COLLECTOR")) {
  
              authority = new SimpleGrantedAuthority(SecurityAuthoritiesEnum.COLLECTOR.toString());
  
          } else {
  
              if (headerValue.contains("ANONYMOUS")) {
                  authority = new SimpleGrantedAuthority(SecurityAuthoritiesEnum.SCREEN.toString());
              } else {
                  authority = new SimpleGrantedAuthority(SecurityAuthoritiesEnum.REGULAR.toString());
              }
  
          }
  
          LOG.info("Role assigned: " + authority.getAuthority());
  
          return new MirrorgateAuthenticationToken(headerValue, Collections.singletonList(authority));
      }
focal_method.class_method_signature: TokenCreator.createHeaderBasedToken(final String headerValue)
focal_method.full_signature: public static MirrorgateAuthenticationToken createHeaderBasedToken(final String headerValue)
focal_method.identifier: createHeaderBasedToken
focal_method.invocations: isEmpty contains toString contains toString toString info getAuthority singletonList
focal_method.modifiers: public static
focal_method.parameters: (final String headerValue)
focal_method.return: MirrorgateAuthenticationToken
focal_method.signature: MirrorgateAuthenticationToken createHeaderBasedToken(final String headerValue)