test_class.declarator: underTest
test_class.modifier: private
test_class.original_string: private SubjectIdReplacementDefinition underTest;
test_class.type: SubjectIdReplacementDefinition
test_class.var_name: underTest
test_class.file: services/concierge/enforcement/src/test/java/org/eclipse/ditto/services/concierge/enforcement/placeholders/SubjectIdReplacementDefinitionTest.java
test_class.identifier: SubjectIdReplacementDefinitionTest
test_case.body: @Test
      public void succeedsWhenHeadersContainSubjectId() {
          final String subjectId = "nginx:first";
          final DittoHeaders validHeaders = DittoHeaders.newBuilder()
                  .authorizationContext(AuthorizationContext.newInstance(DittoAuthorizationContextType.UNSPECIFIED,
                          AuthorizationSubject.newInstance(subjectId), AuthorizationSubject.newInstance("nginx:second")))
                  .build();
  
          final String actualSubjectId = underTest.apply(validHeaders);
  
          assertThat(actualSubjectId).isEqualTo(subjectId);
      }
test_case.class_method_signature: SubjectIdReplacementDefinitionTest.succeedsWhenHeadersContainSubjectId()
test_case.full_signature: @Test public void succeedsWhenHeadersContainSubjectId()
test_case.identifier: succeedsWhenHeadersContainSubjectId
test_case.invocations: build authorizationContext newBuilder newInstance newInstance newInstance apply isEqualTo assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void succeedsWhenHeadersContainSubjectId()
focal_class.declarator: REPLACER_NAME = "request:subjectId"
focal_class.modifier: static final
focal_class.original_string: static final String REPLACER_NAME = "request:subjectId";
focal_class.type: String
focal_class.var_name: REPLACER_NAME
focal_class.declarator: LEGACY_REPLACER_NAME = "request.subjectId"
focal_class.modifier: static final
focal_class.original_string: static final String LEGACY_REPLACER_NAME = "request.subjectId";
focal_class.type: String
focal_class.var_name: LEGACY_REPLACER_NAME
focal_class.declarator: INSTANCE = new SubjectIdReplacementDefinition()
focal_class.modifier: private static final
focal_class.original_string: private static final SubjectIdReplacementDefinition INSTANCE = new SubjectIdReplacementDefinition();
focal_class.type: SubjectIdReplacementDefinition
focal_class.var_name: INSTANCE
focal_class.file: services/concierge/enforcement/src/main/java/org/eclipse/ditto/services/concierge/enforcement/placeholders/SubjectIdReplacementDefinition.java
focal_class.identifier: SubjectIdReplacementDefinition
focal_class.interfaces: implements Function<DittoHeaders, String>
focal_class.class_method_signature: SubjectIdReplacementDefinition.SubjectIdReplacementDefinition()
focal_class.full_signature: private  SubjectIdReplacementDefinition()
focal_class.identifier: SubjectIdReplacementDefinition
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  SubjectIdReplacementDefinition()
focal_class.class_method_signature: SubjectIdReplacementDefinition.getInstance()
focal_class.full_signature: public static SubjectIdReplacementDefinition getInstance()
focal_class.identifier: getInstance
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: SubjectIdReplacementDefinition
focal_class.signature: SubjectIdReplacementDefinition getInstance()
focal_class.class_method_signature: SubjectIdReplacementDefinition.apply(final DittoHeaders dittoHeaders)
focal_class.full_signature: @Override public String apply(final DittoHeaders dittoHeaders)
focal_class.identifier: apply
focal_class.modifiers: @Override public
focal_class.parameters: (final DittoHeaders dittoHeaders)
focal_class.return: String
focal_class.signature: String apply(final DittoHeaders dittoHeaders)
focal_method.body: @Override
      public String apply(final DittoHeaders dittoHeaders) {
          requireNonNull(dittoHeaders);
  
          return dittoHeaders.getAuthorizationContext().getFirstAuthorizationSubject()
                  .map(AuthorizationSubject::getId)
                  .orElseThrow(() -> new IllegalStateException("AuthorizationContext must be available when this " +
                          "function is applied!"));
      }
focal_method.class_method_signature: SubjectIdReplacementDefinition.apply(final DittoHeaders dittoHeaders)
focal_method.full_signature: @Override public String apply(final DittoHeaders dittoHeaders)
focal_method.identifier: apply
focal_method.invocations: requireNonNull orElseThrow map getFirstAuthorizationSubject getAuthorizationContext
focal_method.modifiers: @Override public
focal_method.parameters: (final DittoHeaders dittoHeaders)
focal_method.return: String
focal_method.signature: String apply(final DittoHeaders dittoHeaders)