Search in sources :

Example 1 with CustomRandomDataProviderStrategy

use of uk.co.jemos.podam.test.strategies.CustomRandomDataProviderStrategy 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)

Aggregations

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