	@Test
	public void headerIsSetWhenMetadataPresent() {

		Map<String, String> metadata = new HashMap<>();
		metadata.put("cfAppGuid", "123");
		metadata.put("cfInstanceIndex", "4");
		when(instance.getMetadata()).thenReturn(metadata);

		HttpRequest transformedRequest = transformer.transformRequest(request, instance);

		assertThat(transformedRequest.getHeaders().get("foo"), contains("bar", "baz"));
		assertEquals("123:4", transformedRequest.getHeaders().getFirst("X-CF-APP-INSTANCE"));

	}