HttpAssertionFacadeImpl implements HttpAssertionFacade { @Override public void varAssignedFromHeader(@InflateContext.Ignore String varName, String headerName) { String value = this.facade.response().getHeader(headerName); this.world.put(varName, value); }  @Override void bodyEqualTo(String body); @Override void bodyNotEqualTo(String body); @Override void bodyNotEmpty(); @Override void bodyContains(String body); @Override void bodyDoesNotContain(String body); @Override void headerIsEmpty(String headerName); @Override void headerIsNotEmpty(String headerName); @Override void statusCodeIs(final int statusCode); @Override void statusCodeIsNot(int statusCode); @Override void headerEndsWith(String headerName, String suffix); @Override void varAssignedFromHeader(@InflateContext.Ignore String varName, String headerName); @Override void headerEqualTo(String headerName, String value); @Override void headerNotEqualTo(String headerName, String value); @Override void headerContains(String headerName, String text); @Override void headerDoesNotContain(String headerName, String text); @Override void bodyContainsPropertiesFromJson(String json); @Override void bodyContainsPathWithValue(String path, String value); @Override void bodyContainsPathWithOtherValue(String path, String value); @Override void bodyDoesNotContainPath(String path); @Override void bodyContainsArrayWithSize(String path, String size); @Override void bodyContainsArrayWithEntryHavingValue(String path, String value); @Override void bodyContainsPathOfType(String path, String type); @Override void bodyContainsPathMatchingPattern(String path, String pattern); @Override void bodyContainsPathNotMatchingPattern(String path, String pattern); @Override void varAssignedFromProperty(@InflateContext.Ignore String varName, String property); @Override void varAssignedFromBody(@InflateContext.Ignore String varName); @Override void bodyContainsJsonPathValueContainingPhrase(String path, String phrase); @Override void failureOccurs(String exceptionClass); @Override void failureIsExpected(); @Override void bodyContainsArrayWithObjectHavingProperty(String path, String property, String value);  }
@Test public void shouldNotInflateVarName() { String headerName = "name"; HttpResponseFacade mock = mock(HttpResponseFacade.class); Response response = mock(Response.class); when(response.getHeader(anyString())).thenReturn(headerName); when(mock.response()).thenReturn(response); ((HttpAssertionFacadeImpl) facade).facade = mock; world.put("id", "1"); facade.varAssignedFromHeader("{(id)}", headerName); Optional<String> value = world.get("id"); assertThat(value, CustomMatchers.equalToOptional(headerName)); }