@Test
public void schemaDepViolation() {

    Schema billingAddressSchema = new StringSchema();
    ObjectSchema subject = ObjectSchema.builder()
            .addPropertySchema("name", new StringSchema())
            .addPropertySchema("credit_card", NumberSchema.builder().build())
            .schemaDependency("credit_card", ObjectSchema.builder()
                    .addPropertySchema("billing_address", billingAddressSchema)
                    .addRequiredProperty("billing_address")
                    .build())
            .build();
    TestSupport.expectFailure(subject, billingAddressSchema, "#/billing_address",
            OBJECTS.get("schemaDepViolation"));
}