Search in sources :

Example 96 with PodamFactory

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

the class PodamFactoryBasicTypesTest method podamShouldSupportCircularDependencies.

@Test
@Title("Podam should fill in POJOs which have a circular dependency")
public void podamShouldSupportCircularDependencies() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
    Parent parent = podamInvocationSteps.whenIInvokeTheFactoryForClass(Parent.class, podamFactory);
    podamValidationSteps.thePojoMustBeOfTheType(parent, Parent.class);
    Child child = parent.getChild();
    podamValidationSteps.thePojoMustBeOfTheType(child, Child.class);
}
Also used : Parent(uk.co.jemos.podam.test.dto.pdm6.Parent) PodamFactory(uk.co.jemos.podam.api.PodamFactory) Child(uk.co.jemos.podam.test.dto.pdm6.Child) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Example 97 with PodamFactory

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

the class PodamFactoryBasicTypesTest method podamShouldIgnoreWildcardEnumFields.

@Test
@Title("Podam should fill in wildcard Enum fields")
public void podamShouldIgnoreWildcardEnumFields() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
    WildcardEnumPojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(WildcardEnumPojo.class, podamFactory);
    podamValidationSteps.thePojoMustBeOfTheType(pojo, WildcardEnumPojo.class);
    Enum<?> wildcardEnumField = pojo.getWildcardEnumField();
    podamValidationSteps.thePojoMustBeOfTheType(wildcardEnumField, Enum.class);
}
Also used : PodamFactory(uk.co.jemos.podam.api.PodamFactory) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Example 98 with PodamFactory

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

the class PodamFactoryBasicTypesTest method podamShouldFillJavaStringType.

@Test
@Title("Podam should fill Java string type")
public void podamShouldFillJavaStringType() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
    String pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(String.class, podamFactory);
    podamValidationSteps.theStringFieldCannotBeNullOrEmpty(pojo);
}
Also used : PodamFactory(uk.co.jemos.podam.api.PodamFactory) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Example 99 with PodamFactory

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

the class PodamFactoryBasicTypesTest method podamShouldFillJavaStringTypeWithFullConstructor.

@Test
@Title("Podam should fill Java string type with full constructor")
public void podamShouldFillJavaStringTypeWithFullConstructor() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
    String pojo = podamInvocationSteps.whenIInvokeTheFactoryForClassWithFullConstructor(String.class, podamFactory);
    podamValidationSteps.theStringFieldCannotBeNullOrEmpty(pojo);
}
Also used : PodamFactory(uk.co.jemos.podam.api.PodamFactory) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Example 100 with PodamFactory

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

the class PodamFactoryBasicTypesTest method invokingPodamOnAnInterfaceShouldReturnAnEmptyPojo.

@Test
@Title("Invoking Podam on an interface should return an empty POJO")
public void invokingPodamOnAnInterfaceShouldReturnAnEmptyPojo() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
    InterfacePojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(InterfacePojo.class, podamFactory);
    podamValidationSteps.thePojoShouldBeNull(pojo);
}
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