@Test
public void initializeWithCopiedPolicyAndWithInitialPolicy() {

    final DittoHeaders v2Headers = DittoHeaders.newBuilder().schemaVersion(JsonSchemaVersion.LATEST).build();
    final Thing thingWithoutAclAndPolicy = TestConstants.Thing.THING.toBuilder()
            .removeAllPermissions()
            .removePolicyId()
            .build();
    final String thingReference = "{{ ref:things/my_namespace:my_thing/policyId }}";
    assertThatThrownBy(() ->
            ModifyThing.of(TestConstants.Thing.THING_ID, thingWithoutAclAndPolicy, JsonObject.newBuilder().build(),
                    thingReference,
                    v2Headers))
            .isInstanceOf(PoliciesConflictingException.class)
            .hasMessage(MessageFormat.format(
                    "The Thing with ID ''{0}'' could not be created as it contained an inline " +
                            "Policy as well as a policyID to copy.", TestConstants.Thing.THING_ID));
}