@Test
    public void shouldGetValueFromRequestOverwriteTrue() {
        request.getHeaders().put("the-header-to-read-from","value-to-copy");
        request.getHeaders().put("the-target-header","old-value-to-be-overwritten");

        AddHeaderBean header = spy(new AddHeaderBean());

        header.setHeaderName("the-target-header");
        header.setHeaderValue("the-header-to-read-from");
        header.setOverwrite(true);
        header.setApplyTo(ApplyTo.REQUEST);
        header.setValueType(ValueType.HEADER);
        config.getAddHeaders().add(header);

        policy.apply(request, mContext, config, mRequestChain);

        assertEquals("value-to-copy", request.getHeaders().get("the-target-header"));
        assertEquals(2, request.getHeaders().size());
    }
@author Marc Savy {@literal <msavy@redhat.com>}
plugins/simple-header-policy/src/test/java/io/apiman/plugins/simpleheaderpolicy/SimpleHeaderPolicyTest.java