Search in sources :

Example 1 with MemoizationPojo

use of uk.co.jemos.podam.test.dto.MemoizationPojo in project podam by devopsfolks.

the class MemoizationTest method memoizationShouldWorkCorrectlyForCollectionsAndArrays.

@Test
@Title("Memoization should work correctly for collections and arrays")
public void memoizationShouldWorkCorrectlyForCollectionsAndArrays() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactoryWithMemoizationEnabled();
    podamValidationSteps.theMemoizationShouldBeEnabled(podamFactory.getStrategy(), true);
    MemoizationPojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(MemoizationPojo.class, podamFactory);
    podamValidationSteps.thePojoMustBeOfTheType(pojo, MemoizationPojo.class);
    podamValidationSteps.theArrayOfTheGivenTypeShouldNotBeNullOrEmptyAndContainExactlyTheGivenNumberOfElements(pojo.getArray(), podamFactory.getStrategy().getNumberOfCollectionElements(Currency.class), Currency.class);
    podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndShouldHaveExactlyTheExpectedNumberOfElements(pojo.getCollection(), Currency.class, podamFactory.getStrategy().getNumberOfCollectionElements(Currency.class));
    podamValidationSteps.theMapShouldNotBeNullOrEmptyAndShouldHaveExactlyTheExpectedNumberOfElements(pojo.getMap(), Currency.class, Currency.class, podamFactory.getStrategy().getNumberOfCollectionElements(Currency.class));
}
Also used : MemoizationPojo(uk.co.jemos.podam.test.dto.MemoizationPojo) PodamFactory(uk.co.jemos.podam.api.PodamFactory) Currency(java.util.Currency) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Aggregations

Currency (java.util.Currency)1 Title (net.thucydides.core.annotations.Title)1 Test (org.junit.Test)1 PodamFactory (uk.co.jemos.podam.api.PodamFactory)1 MemoizationPojo (uk.co.jemos.podam.test.dto.MemoizationPojo)1