NotSchema extends Schema { public static Builder builder() { return new Builder(); } NotSchema(final Builder builder); static Builder builder(); Schema getMustNotMatch(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void failure() { NotSchema subject = buildWithLocation(NotSchema.builder().mustNotMatch(BooleanSchema.INSTANCE)); TestSupport.failureOf(subject) .input(true) .expectedKeyword("not") .expect(); }
@Test public void success() { NotSchema.builder().mustNotMatch(BooleanSchema.INSTANCE).build().validate("foo"); }
@Test public void toStringTest() { NotSchema subject = NotSchema.builder() .mustNotMatch(BooleanSchema.INSTANCE) .build(); String actual = subject.toString(); assertEquals("{\"not\":{\"type\":\"boolean\"}}", actual); }
@Test public void issue345() { JSONObject rawSchema = LOADER.readObj("issue345.json"); Schema notSchema = SchemaLoader.builder() .schemaJson(rawSchema) .build().load().build(); assertThat(new JSONObject(notSchema.toString()), sameJsonAs(rawSchema)); }