HttpApiKeyAuthConverter implements SecuritySchemeConverter<HttpApiKeyAuthTrait> { @Override public Set<String> getAuthRequestHeaders(Context<? extends Trait> context, HttpApiKeyAuthTrait trait) { return SetUtils.of(trait.getName()); }  @Override Class<HttpApiKeyAuthTrait> getAuthSchemeType(); @Override SecurityScheme createSecurityScheme(Context<? extends Trait> context, HttpApiKeyAuthTrait trait); @Override Set<String> getAuthRequestHeaders(Context<? extends Trait> context, HttpApiKeyAuthTrait trait);  }
@Test public void returnsTraitHeader() { HttpApiKeyAuthConverter converter = new HttpApiKeyAuthConverter(); HttpApiKeyAuthTrait trait = HttpApiKeyAuthTrait.builder() .name("x-api-key") .in(HttpApiKeyAuthTrait.Location.HEADER) .build(); assertThat(converter.getAuthRequestHeaders(null, trait), containsInAnyOrder("x-api-key")); }