ExtraFieldPropagation implements Propagation<K> { @Deprecated public static Map<String, String> getAll() { return BaggageField.getAllValues(); } ExtraFieldPropagation(Propagation<K> delegate, List<K> extraKeys); @Deprecated static Factory newFactory(Propagation.Factory delegate, String... names); @Deprecated static Factory newFactory(Propagation.Factory delegate,
    Collection<String> names); @Deprecated static FactoryBuilder newFactoryBuilder(Propagation.Factory delegate); @Deprecated @Nullable static String current(String name); @Deprecated @Nullable static String get(String name); @Deprecated static void set(String name, String value); @Deprecated static Map<String, String> getAll(); @Deprecated static Map<String, String> getAll(TraceContextOrSamplingFlags extracted); @Deprecated static Map<String, String> getAll(TraceContext context); @Deprecated @Nullable static String get(TraceContext context, String name); @Deprecated static void set(TraceContext context, String name, String value); @Deprecated List<K> extraKeys(); @Override List<K> keys(); @Override Injector<R> injector(Setter<R, K> setter); @Override Extractor<R> extractor(Getter<R, K> getter);  }
@Test public void getAll() { TraceContext context = extractWithAmazonTraceId(); assertThat(ExtraFieldPropagation.getAll(context)) .hasSize(1) .containsEntry("x-amzn-trace-id", awsTraceId); }
@Test public void getAll_extracted() { injector.inject(context, request); request.put("x-amzn-trace-id", awsTraceId); TraceContextOrSamplingFlags extracted = extractor.extract(request); assertThat(ExtraFieldPropagation.getAll(extracted)) .hasSize(1) .containsEntry("x-amzn-trace-id", awsTraceId); }
@Test public void getAll_extractedWithContext() { request.put("x-amzn-trace-id", awsTraceId); TraceContextOrSamplingFlags extracted = extractor.extract(request); assertThat(ExtraFieldPropagation.getAll(extracted)) .hasSize(1) .containsEntry("x-amzn-trace-id", awsTraceId); }
@Test public void getAll_two() { injector.inject(context, request); request.put("x-amzn-trace-id", awsTraceId); request.put("x-vcap-request-id", uuid); context = extractor.extract(request).context(); assertThat(ExtraFieldPropagation.getAll(context)) .hasSize(2) .containsEntry("x-amzn-trace-id", awsTraceId) .containsEntry("x-vcap-request-id", uuid); }
@Test public void getAll_empty_if_no_extraField() { assertThat(ExtraFieldPropagation.getAll(context)) .isEmpty(); }