Search in sources :

Example 91 with PodamFactory

use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.

the class PodamFactoryBasicTypesTest method podamShouldFillPojosWithNonDefaultConstructor.

@Test
@Title("Podam should fill POJOs with non default constructors")
public void podamShouldFillPojosWithNonDefaultConstructor() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
    NoDefaultConstructorPojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(NoDefaultConstructorPojo.class, podamFactory);
    podamValidationSteps.thePojoMustBeOfTheType(pojo, NoDefaultConstructorPojo.class);
}
Also used : PodamFactory(uk.co.jemos.podam.api.PodamFactory) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Example 92 with PodamFactory

use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.

the class PodamFactoryBasicTypesTest method podamShouldSupportRecursiveMaps.

@Test
@Title("Podam should fill in Maps of the containing class type")
public void podamShouldSupportRecursiveMaps() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
    RecursiveMap recursiveMap = podamInvocationSteps.whenIInvokeTheFactoryForClass(RecursiveMap.class, podamFactory);
    podamValidationSteps.thePojoMustBeOfTheType(recursiveMap, RecursiveMap.class);
    podamValidationSteps.theMapShouldNotBeNullOrEmptyAndContainElementsOfType(recursiveMap.getMap(), String.class, RecursiveMap.class);
}
Also used : PodamFactory(uk.co.jemos.podam.api.PodamFactory) RecursiveMap(uk.co.jemos.podam.test.dto.pdm6.RecursiveMap) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Example 93 with PodamFactory

use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.

the class PodamFactoryBasicTypesTest method invokingPodamOnAbstractClassShouldReturnANullPojo.

@Test
@Title("Invoking Podam on an Abstract class should return a null pojo")
public void invokingPodamOnAbstractClassShouldReturnANullPojo() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
    AbstractTestPojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(AbstractTestPojo.class, podamFactory);
    podamValidationSteps.thePojoShouldBeNull(pojo);
}
Also used : PodamFactory(uk.co.jemos.podam.api.PodamFactory) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Example 94 with PodamFactory

use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.

the class PodamFactoryBasicTypesTest method podamShouldFillRecursivePojosWhenInvokingPopulationDirectly.

@Test
@Title("Podam should fill recursive POJOs when invoking the factory population directly")
public void podamShouldFillRecursivePojosWhenInvokingPopulationDirectly() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
    RecursivePojo pojo = new RecursivePojo();
    podamInvocationSteps.whenIInvokeThePojoPopulationDirectly(pojo, podamFactory);
    recursivePojoValidationSteps.allPojosInTheRecursiveStrategyShouldBeValid(pojo);
}
Also used : PodamFactory(uk.co.jemos.podam.api.PodamFactory) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Example 95 with PodamFactory

use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.

the class PodamFactoryBasicTypesTest method podamShouldFillArraysWithElements.

@Test
@Title("Podam should fill arrays with elements")
public void podamShouldFillArraysWithElements() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
    ArrayPojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(ArrayPojo.class, podamFactory);
    podamValidationSteps.theArrayOfTheGivenTypeShouldNotBeNullOrEmptyAndContainElementsOfTheRightType(pojo.getMyStringArray(), String.class);
    podamValidationSteps.theArrayOfTheGivenTypeShouldNotBeNullOrEmptyAndContainElementsOfTheRightType(pojo.getMyObjectArray(), Object.class);
}
Also used : PodamFactory(uk.co.jemos.podam.api.PodamFactory) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Aggregations

PodamFactory (uk.co.jemos.podam.api.PodamFactory)130 Test (org.junit.Test)127 Title (net.thucydides.core.annotations.Title)126 Validator (javax.validation.Validator)4 DataProviderStrategy (uk.co.jemos.podam.api.DataProviderStrategy)3 Calendar (java.util.Calendar)2 GregorianCalendar (java.util.GregorianCalendar)2 AbstractRandomDataProviderStrategy (uk.co.jemos.podam.api.AbstractRandomDataProviderStrategy)2 PodamFactoryImpl (uk.co.jemos.podam.api.PodamFactoryImpl)2 PojoWithMapsAndCollections (uk.co.jemos.podam.test.dto.PojoWithMapsAndCollections)2 SimplePojoToTestSetters (uk.co.jemos.podam.test.dto.SimplePojoToTestSetters)2 GenericCollectionsConstructorPojo (uk.co.jemos.podam.test.dto.issue123.GenericCollectionsConstructorPojo)2 BeanContextServicesSupport (java.beans.beancontext.BeanContextServicesSupport)1 InputStream (java.io.InputStream)1 BigDecimal (java.math.BigDecimal)1 URL (java.net.URL)1 Timestamp (java.sql.Timestamp)1 Currency (java.util.Currency)1 Date (java.util.Date)1 Observable (java.util.Observable)1