@Test public void filter() throws Exception { ClientRequestContext requestContext = mock(ClientRequestContext.class); MultivaluedMap headers = new MultivaluedHashMap(); when(requestContext.getHeaders()).thenReturn(headers); VersionHeaderDecorator versionHeaderDecorator = new VersionHeaderDecorator(); versionHeaderDecorator.filter(requestContext); assertThat(headers.get(Constants.API_VERSION_HEADER)).isNotNull().isEqualTo(ApiVersion.versions()); verify(requestContext).getHeaders(); verifyNoMoreInteractions(requestContext); }
@Override public void filter(ClientRequestContext requestContext) throws IOException { ApiVersion.versions().forEach(v -> requestContext.getHeaders().add(Constants.API_VERSION_HEADER, v)); }
VersionHeaderDecorator implements ClientRequestFilter { @Override public void filter(ClientRequestContext requestContext) throws IOException { ApiVersion.versions().forEach(v -> requestContext.getHeaders().add(Constants.API_VERSION_HEADER, v)); } }
VersionHeaderDecorator implements ClientRequestFilter { @Override public void filter(ClientRequestContext requestContext) throws IOException { ApiVersion.versions().forEach(v -> requestContext.getHeaders().add(Constants.API_VERSION_HEADER, v)); }  }
VersionHeaderDecorator implements ClientRequestFilter { @Override public void filter(ClientRequestContext requestContext) throws IOException { ApiVersion.versions().forEach(v -> requestContext.getHeaders().add(Constants.API_VERSION_HEADER, v)); }  @Override void filter(ClientRequestContext requestContext); }
VersionHeaderDecorator implements ClientRequestFilter { @Override public void filter(ClientRequestContext requestContext) throws IOException { ApiVersion.versions().forEach(v -> requestContext.getHeaders().add(Constants.API_VERSION_HEADER, v)); }  @Override void filter(ClientRequestContext requestContext);  }