use of uk.co.jemos.podam.test.dto.RecursivePojo in project podam by devopsfolks.
the class MemoizationTest method memoizationShouldWorkForRecursivePojos.
@Test
@Title("Memoization should work for recursive Pojos")
public void memoizationShouldWorkForRecursivePojos() throws Exception {
PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactoryWithMemoizationEnabled();
podamValidationSteps.theMemoizationShouldBeEnabled(podamFactory.getStrategy(), true);
RecursivePojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(RecursivePojo.class, podamFactory);
podamValidationSteps.thePojoMustBeOfTheType(pojo, RecursivePojo.class);
podamValidationSteps.theTwoObjectsShouldBeStrictlyEqual(pojo, pojo.getParent());
}
use of uk.co.jemos.podam.test.dto.RecursivePojo in project podam by devopsfolks.
the class RecursivePojoValidationSteps method allPojosInTheRecursiveStrategyShouldBeValid.
@Step("Then all the POJOs in the recursive hierarchy should be valid")
public void allPojosInTheRecursiveStrategyShouldBeValid(RecursivePojo pojo) {
assertThat("The integer value in the pojo should not be zero!", pojo.getIntField(), not(equalTo(0)));
RecursivePojo parentPojo = pojo.getParent();
assertThat("The parent pojo cannot be null!", parentPojo, not(nullValue()));
assertThat("The integer value in the parent pojo should not be zero!", parentPojo.getIntField(), not(equalTo(0)));
assertThat("The parent attribute of the parent pojo cannot be null!", parentPojo.getParent(), not(nullValue()));
}
Aggregations