use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.
the class ReadOnlyComplexTypesTest method podamShouldFillReadOnlyTypes.
@Test
@Title("Podam should fill in read-only POJOs")
public void podamShouldFillReadOnlyTypes() throws Exception {
PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
ReadOnlyComplexTypesPojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(ReadOnlyComplexTypesPojo.class, podamFactory);
podamValidationSteps.thePojoMustBeOfTheType(pojo, ReadOnlyComplexTypesPojo.class);
podamValidationSteps.theArrayOfTheGivenTypeShouldNotBeNullOrEmptyAndContainElementsOfTheRightType(pojo.getArray(), String.class);
podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getList(), Integer.class);
podamValidationSteps.theMapShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getMap(), Long.class, String.class);
podamValidationSteps.thePojoMustBeOfTheType(pojo.getValue(), ReadOnlyComplexTypesPojo.Value.class);
podamValidationSteps.thePojoMustBeOfTheType(pojo.getValue().getValue(), String.class);
}
use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.
the class ReadOnlyComplexTypesTest method podamShouldFillInPojosWhichContainInternalLoops.
@Test
@Title("Podam should fill in POJOs which contain internal loops (e.g. objects that reference parents)")
public void podamShouldFillInPojosWhichContainInternalLoops() throws Exception {
PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
BeanContextServicesSupport pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(BeanContextServicesSupport.class, podamFactory);
podamValidationSteps.thePojoMustBeOfTheType(pojo, BeanContextServicesSupport.class);
}
use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.
the class ConstructorsUnitTest method podamShouldHandleGenericsInSettersDuringPojoInstantiation.
@Test
@Title("Podam should handle generics in setters during Pojo instantiation")
public void podamShouldHandleGenericsInSettersDuringPojoInstantiation() throws Exception {
PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
GenericInSetterPojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(GenericInSetterPojo.class, podamFactory);
podamValidationSteps.thePojoMustBeOfTheType(pojo, GenericInSetterPojo.class);
podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getVector(), String.class);
}
use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.
the class ConstructorsUnitTest method podamShouldHandleConstructorsWithGenericArraysDuringPojoInstantiation.
@Test
@Title("Podam should handle constructors with generic arrays during Pojo instantiation")
public void podamShouldHandleConstructorsWithGenericArraysDuringPojoInstantiation() {
PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
GenericArrayInConstructorPojo<?> pojo = podamInvocationSteps.whenIInvokeTheFactoryForGenericTypeWithSpecificType(GenericArrayInConstructorPojo.class, podamFactory, String.class);
podamValidationSteps.thePojoMustBeOfTheType(pojo, GenericArrayInConstructorPojo.class);
podamValidationSteps.theArrayOfTheGivenTypeShouldNotBeNullOrEmptyAndContainElementsOfTheRightType(pojo.getArray(), String.class);
}
use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.
the class ConstructorsUnitTest method podamShouldHandleGenericsInConstructor.
@Test
@Title("Podam should handle generics in the constructor")
public void podamShouldHandleGenericsInConstructor() throws Exception {
PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
GenericInConstructorPojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(GenericInConstructorPojo.class, podamFactory);
podamValidationSteps.thePojoMustBeOfTheType(pojo, GenericInConstructorPojo.class);
podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getVector(), String.class);
}
Aggregations