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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations