@Test
    public void shouldOverwriteWhenFlagSet() {
        request.getHeaders().put("X-Clacks-Overhead", "Ridcully");

        AddHeaderBean header = new AddHeaderBean();
        header.setHeaderName("X-Clacks-Overhead");
        header.setHeaderValue("GNU Terry Pratchett");
        header.setOverwrite(true);
        header.setApplyTo(ApplyTo.REQUEST);
        header.setValueType(ValueType.STRING);
        config.getAddHeaders().add(header);

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

        assertEquals("GNU Terry Pratchett", request.getHeaders().get("X-Clacks-Overhead"));
        assertEquals(1, request.getHeaders().size());
    }
@author Marc Savy {@literal <msavy@redhat.com>}
plugins/simple-header-policy/src/test/java/io/apiman/plugins/simpleheaderpolicy/SimpleHeaderPolicyTest.java