Search in sources :

Example 1 with PojoWithMapsAndCollections

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

the class ExtensionsTest method podamShouldCreatePojosInAccordanceWithCustomDataProviderStrategies.

@Test
@Title("Podam should create POJOs in accordance with custom data provider strategies")
public void podamShouldCreatePojosInAccordanceWithCustomDataProviderStrategies() throws Exception {
    CustomRandomDataProviderStrategy strategy = podamFactorySteps.givenACustomRandomDataProviderStrategy();
    PodamFactory podamFactory = podamFactorySteps.givenAPodamFactoryWithCustomDataProviderStrategy(strategy);
    PojoWithMapsAndCollections pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(PojoWithMapsAndCollections.class, podamFactory);
    podamValidationSteps.theObjectShouldNotBeNull(pojo);
    podamValidationSteps.theArrayOfTheGivenTypeShouldNotBeNullOrEmptyAndContainExactlyTheGivenNumberOfElements(pojo.getArray(), 2, String.class);
    podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndShouldHaveExactlyTheExpectedNumberOfElements(pojo.getList(), Boolean.class, 3);
    podamValidationSteps.theMapShouldNotBeNullOrEmptyAndShouldHaveExactlyTheExpectedNumberOfElements(pojo.getMap(), Integer.class, Long.class, 4);
}
Also used : PodamFactory(uk.co.jemos.podam.api.PodamFactory) PojoWithMapsAndCollections(uk.co.jemos.podam.test.dto.PojoWithMapsAndCollections) CustomRandomDataProviderStrategy(uk.co.jemos.podam.test.strategies.CustomRandomDataProviderStrategy) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Example 2 with PojoWithMapsAndCollections

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

the class RandomDataProviderStrategyImplInitialisationUnitTest method podamShouldCreatePojosInAccordanceWithCustomDataProviderStrategies.

@Test
@Title("Podam should create POJOs in accordance with custom data provider strategies")
public void podamShouldCreatePojosInAccordanceWithCustomDataProviderStrategies() throws Exception {
    DataProviderStrategy strategy = podamFactorySteps.givenACustomRandomDataProviderStrategy();
    PodamFactory podamFactory = podamFactorySteps.givenAPodamFactoryWithCustomDataProviderStrategy(strategy);
    PojoWithMapsAndCollections pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(PojoWithMapsAndCollections.class, podamFactory);
    podamValidationSteps.theObjectShouldNotBeNull(pojo);
    podamValidationSteps.theArrayOfTheGivenTypeShouldNotBeNullOrEmptyAndContainExactlyTheGivenNumberOfElements(pojo.getArray(), 2, String.class);
    podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndShouldHaveExactlyTheExpectedNumberOfElements(pojo.getList(), Boolean.class, 3);
    podamValidationSteps.theMapShouldNotBeNullOrEmptyAndShouldHaveExactlyTheExpectedNumberOfElements(pojo.getMap(), Integer.class, Long.class, 4);
}
Also used : DataProviderStrategy(uk.co.jemos.podam.api.DataProviderStrategy) AbstractRandomDataProviderStrategy(uk.co.jemos.podam.api.AbstractRandomDataProviderStrategy) PodamFactory(uk.co.jemos.podam.api.PodamFactory) PojoWithMapsAndCollections(uk.co.jemos.podam.test.dto.PojoWithMapsAndCollections) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Aggregations

Title (net.thucydides.core.annotations.Title)2 Test (org.junit.Test)2 PodamFactory (uk.co.jemos.podam.api.PodamFactory)2 PojoWithMapsAndCollections (uk.co.jemos.podam.test.dto.PojoWithMapsAndCollections)2 AbstractRandomDataProviderStrategy (uk.co.jemos.podam.api.AbstractRandomDataProviderStrategy)1 DataProviderStrategy (uk.co.jemos.podam.api.DataProviderStrategy)1 CustomRandomDataProviderStrategy (uk.co.jemos.podam.test.strategies.CustomRandomDataProviderStrategy)1