test_class.file: protocol-adapter/src/test/java/org/eclipse/ditto/protocoladapter/HeaderEntryFiltersTest.java
test_class.identifier: HeaderEntryFiltersTest
test_case.body: @Test
      public void toExternalHeadersFilterDiscardsDittoInternalAckRequests() {
          final DittoHeaderDefinition headerDefinition = DittoHeaderDefinition.REQUESTED_ACKS;
          final Map<String, HeaderDefinition> headerDefinitions =
                  Maps.newHashMap(headerDefinition.getKey(), headerDefinition);
          final List<AcknowledgementRequest> allAcknowledgementRequests = Lists.list(
                  AcknowledgementRequest.of(AcknowledgementLabel.of("foo")),
                  AcknowledgementRequest.of(DittoAcknowledgementLabel.TWIN_PERSISTED),
                  AcknowledgementRequest.of(AcknowledgementLabel.of("bar")));
          final JsonArray allAcknowledgementRequestsJsonArray = allAcknowledgementRequests.stream()
                  .map(AcknowledgementRequest::toString)
                  .map(JsonValue::of)
                  .collect(JsonCollectors.valuesToArray());
          final String value = allAcknowledgementRequestsJsonArray.toString();
          final JsonArray externalAcknowledgementRequests = allAcknowledgementRequestsJsonArray.toBuilder()
                  .remove(1)
                  .build();
          final String expected = externalAcknowledgementRequests.toString();
  
          final HeaderEntryFilter underTest = HeaderEntryFilters.toExternalHeadersFilter(headerDefinitions);
  
          assertThat(underTest.apply(headerDefinition.getKey(), value)).isEqualTo(expected);
      }
test_case.class_method_signature: HeaderEntryFiltersTest.toExternalHeadersFilterDiscardsDittoInternalAckRequests()
test_case.full_signature: @Test public void toExternalHeadersFilterDiscardsDittoInternalAckRequests()
test_case.identifier: toExternalHeadersFilterDiscardsDittoInternalAckRequests
test_case.invocations: newHashMap getKey list of of of of of collect map map stream valuesToArray toString build remove toBuilder toString toExternalHeadersFilter isEqualTo assertThat apply getKey
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void toExternalHeadersFilterDiscardsDittoInternalAckRequests()
focal_class.file: protocol-adapter/src/main/java/org/eclipse/ditto/protocoladapter/HeaderEntryFilters.java
focal_class.identifier: HeaderEntryFilters
focal_class.class_method_signature: HeaderEntryFilters.HeaderEntryFilters()
focal_class.full_signature: private  HeaderEntryFilters()
focal_class.identifier: HeaderEntryFilters
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  HeaderEntryFilters()
focal_class.class_method_signature: HeaderEntryFilters.toExternalHeadersFilter(final Map<String, HeaderDefinition> headerDefinitionMap)
focal_class.full_signature: static HeaderEntryFilter toExternalHeadersFilter(final Map<String, HeaderDefinition> headerDefinitionMap)
focal_class.identifier: toExternalHeadersFilter
focal_class.modifiers: static
focal_class.parameters: (final Map<String, HeaderDefinition> headerDefinitionMap)
focal_class.return: HeaderEntryFilter
focal_class.signature: HeaderEntryFilter toExternalHeadersFilter(final Map<String, HeaderDefinition> headerDefinitionMap)
focal_class.class_method_signature: HeaderEntryFilters.shouldWriteToExternal(final Map<String, HeaderDefinition> headerDefinitions)
focal_class.full_signature: private static HeaderEntryFilter shouldWriteToExternal(final Map<String, HeaderDefinition> headerDefinitions)
focal_class.identifier: shouldWriteToExternal
focal_class.modifiers: private static
focal_class.parameters: (final Map<String, HeaderDefinition> headerDefinitions)
focal_class.return: HeaderEntryFilter
focal_class.signature: HeaderEntryFilter shouldWriteToExternal(final Map<String, HeaderDefinition> headerDefinitions)
focal_class.class_method_signature: HeaderEntryFilters.readJsonArraysFromHeaders(final Map<String, HeaderDefinition> headerDefinitions)
focal_class.full_signature: private static HeaderEntryFilter readJsonArraysFromHeaders(final Map<String, HeaderDefinition> headerDefinitions)
focal_class.identifier: readJsonArraysFromHeaders
focal_class.modifiers: private static
focal_class.parameters: (final Map<String, HeaderDefinition> headerDefinitions)
focal_class.return: HeaderEntryFilter
focal_class.signature: HeaderEntryFilter readJsonArraysFromHeaders(final Map<String, HeaderDefinition> headerDefinitions)
focal_class.class_method_signature: HeaderEntryFilters.discardDittoAckRequests()
focal_class.full_signature: private static HeaderEntryFilter discardDittoAckRequests()
focal_class.identifier: discardDittoAckRequests
focal_class.modifiers: private static
focal_class.parameters: ()
focal_class.return: HeaderEntryFilter
focal_class.signature: HeaderEntryFilter discardDittoAckRequests()
focal_class.class_method_signature: HeaderEntryFilters.fromExternalHeadersFilter(final Map<String, HeaderDefinition> headerDefinitionMap)
focal_class.full_signature: static HeaderEntryFilter fromExternalHeadersFilter(final Map<String, HeaderDefinition> headerDefinitionMap)
focal_class.identifier: fromExternalHeadersFilter
focal_class.modifiers: static
focal_class.parameters: (final Map<String, HeaderDefinition> headerDefinitionMap)
focal_class.return: HeaderEntryFilter
focal_class.signature: HeaderEntryFilter fromExternalHeadersFilter(final Map<String, HeaderDefinition> headerDefinitionMap)
focal_class.class_method_signature: HeaderEntryFilters.existsAsHeaderDefinition(final Map<String, HeaderDefinition> headerDefinitionMap)
focal_class.full_signature: static HeaderEntryFilter existsAsHeaderDefinition(final Map<String, HeaderDefinition> headerDefinitionMap)
focal_class.identifier: existsAsHeaderDefinition
focal_class.modifiers: static
focal_class.parameters: (final Map<String, HeaderDefinition> headerDefinitionMap)
focal_class.return: HeaderEntryFilter
focal_class.signature: HeaderEntryFilter existsAsHeaderDefinition(final Map<String, HeaderDefinition> headerDefinitionMap)
focal_class.class_method_signature: HeaderEntryFilters.existsAsHeaderDefinitionAndExternal(final Map<String, HeaderDefinition> headerDefinitionMap)
focal_class.full_signature: static HeaderEntryFilter existsAsHeaderDefinitionAndExternal(final Map<String, HeaderDefinition> headerDefinitionMap)
focal_class.identifier: existsAsHeaderDefinitionAndExternal
focal_class.modifiers: static
focal_class.parameters: (final Map<String, HeaderDefinition> headerDefinitionMap)
focal_class.return: HeaderEntryFilter
focal_class.signature: HeaderEntryFilter existsAsHeaderDefinitionAndExternal(final Map<String, HeaderDefinition> headerDefinitionMap)
focal_method.body: static HeaderEntryFilter toExternalHeadersFilter(final Map<String, HeaderDefinition> headerDefinitionMap) {
          final HeaderEntryFilter headerEntryFilter = shouldWriteToExternal(headerDefinitionMap);
          if (headerDefinitionMap.isEmpty()) {
              return headerEntryFilter;
          } else {
              // only discard Ditto ack request if any headerDefinitions were set - e.g. that is case for the Ditto backend
              //  the Ditto client should not discard ack requests
              return headerEntryFilter.andThen(discardDittoAckRequests());
          }
      }
focal_method.class_method_signature: HeaderEntryFilters.toExternalHeadersFilter(final Map<String, HeaderDefinition> headerDefinitionMap)
focal_method.full_signature: static HeaderEntryFilter toExternalHeadersFilter(final Map<String, HeaderDefinition> headerDefinitionMap)
focal_method.identifier: toExternalHeadersFilter
focal_method.invocations: shouldWriteToExternal isEmpty andThen discardDittoAckRequests
focal_method.modifiers: static
focal_method.parameters: (final Map<String, HeaderDefinition> headerDefinitionMap)
focal_method.return: HeaderEntryFilter
focal_method.signature: HeaderEntryFilter toExternalHeadersFilter(final Map<String, HeaderDefinition> headerDefinitionMap)