Skip to content

Commit

Permalink
fix shapeTest1
Browse files Browse the repository at this point in the history
  • Loading branch information
MarieTask committed Jan 29, 2024
1 parent 962d581 commit 385a11f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/src/main/java/hexlet/code/schemas/BaseSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ protected final void addCondition(Predicate<Object> condition) {
}
public final boolean isValid(Object obj) {
if (!isRequired && !(conditions.get(0).test(obj))) {
System.out.println(conditions.get(0));
return true;
}
return conditions.stream().allMatch(condition -> condition.test(obj));
Expand Down
2 changes: 1 addition & 1 deletion app/src/test/java/hexlet/code/TestMapSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void shapeTest1() {
Map<String, Object> human1 = new HashMap<>();
human1.put("name", "Kolya");
human1.put("age", MAX_LENGTH);
assertTrue(schema.isValid(human1));
assertFalse(schema.isValid(human1));

Map<String, Object> human2 = new HashMap<>();
human2.put("name", "Maya");
Expand Down

0 comments on commit 385a11f

Please sign in to comment.