How to use shouldRecurseOverSpecialTypes method of org.assertj.core.api.recursive.assertion.RecursiveAssertionDriver class

Best Assertj code snippet using org.assertj.core.api.recursive.assertion.RecursiveAssertionDriver.shouldRecurseOverSpecialTypes

Source:RecursiveAssertionDriver.java Github

copy

Full Screen

...96 }97 private void recurseIntoFieldsOfCurrentNode(Predicate<Object> predicate, Object node, Class<?> nodeType,98 FieldLocation fieldLocation) {99 if (isTypeRequiringSpecificHandling(nodeType)) {100 if (shouldRecurseOverSpecialTypes(nodeType)) {101 doRecursionForSpecialTypes(predicate, node, nodeType, fieldLocation);102 }103 } else if (shouldRecurseIntoNode(node)) {104 evaluateFieldsOfCurrentNodeRecursively(predicate, node, fieldLocation);105 }106 }107 private boolean isTypeRequiringSpecificHandling(Class<?> nodeType) {108 return isCollection(nodeType) || isMap(nodeType) || isArray(nodeType) || isOptionalOrPrimitiveOptional(nodeType);109 }110 private boolean shouldRecurseOverSpecialTypes(Class<?> nodeType) {111 boolean recurseOverContainer = isContainer(nodeType)112 && configuration.getCollectionAssertionPolicy() != COLLECTION_OBJECT_ONLY;113 boolean recurseOverMap = isMap(nodeType) && configuration.getMapAssertionPolicy() != MAP_OBJECT_ONLY;114 boolean recurseOverOptional = isOptionalOrPrimitiveOptional(nodeType)115 && configuration.getOptionalAssertionPolicy() != OPTIONAL_OBJECT_ONLY;116 return recurseOverContainer || recurseOverMap || recurseOverOptional;117 }118 private void doRecursionForSpecialTypes(Predicate<Object> predicate, Object node, Class<?> nodeType,119 FieldLocation fieldLocation) {120 if (isCollection(nodeType)) {121 recurseIntoCollection(predicate, (Collection<?>) node, fieldLocation);122 } else if (isArray(nodeType)) {123 recurseIntoArray(predicate, node, nodeType, fieldLocation);124 } else if (isMap(nodeType)) {...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful