use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.
the class ConstructorsUnitTest method podamShouldCreateInstancesOfGenericReadOnlyPojosWithFactoryMethodsWhenTheConcreteTypeIsKnown.
@Test
@Title("Podam should be able to create instances of generic read only POJOs with factory methods when the concrete type is known")
public void podamShouldCreateInstancesOfGenericReadOnlyPojosWithFactoryMethodsWhenTheConcreteTypeIsKnown() throws Exception {
PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
FactoryInstantiableReadOnlyPojo<?> pojo = podamInvocationSteps.whenIInvokeTheFactoryForGenericTypeWithSpecificType(FactoryInstantiableReadOnlyPojo.class, podamFactory, String.class);
podamValidationSteps.thePojoMustBeOfTheType(pojo, FactoryInstantiableReadOnlyPojo.class);
podamValidationSteps.thePojoMustBeOfTheType(pojo.getTypedValue(), String.class);
}
use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.
the class ConstructorsUnitTest method podamShouldBeAbleToManufactureAnyTypeOfMaps.
@Test
@Title("Podam should be able to manufacture any type of Maps")
public void podamShouldBeAbleToManufactureAnyTypeOfMaps() throws Exception {
PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
UnsupportedMapInConstructorPojo<?, ?> pojo = podamInvocationSteps.whenIInvokeTheFactoryForGenericTypeWithSpecificType(UnsupportedMapInConstructorPojo.class, podamFactory, String.class, Integer.class);
podamValidationSteps.thePojoMustBeOfTheType(pojo, UnsupportedMapInConstructorPojo.class);
podamValidationSteps.theMapShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getHashTable(), String.class, Integer.class);
}
use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.
the class ConstructorsUnitTest method podamShouldHandleGenericCollectionsInConstructorWithMemoizationDisabled.
@Test
@Title("Podam should correctly handle generic collections in constructor with memoization disabled")
public void podamShouldHandleGenericCollectionsInConstructorWithMemoizationDisabled() throws Exception {
PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
GenericCollectionsConstructorPojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(GenericCollectionsConstructorPojo.class, podamFactory);
podamValidationSteps.thePojoMustBeOfTheType(pojo, GenericCollectionsConstructorPojo.class);
podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getList1(), Long.class);
podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getList2(), String.class);
podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getList3(), Integer.class);
}
use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.
the class ConstructorsUnitTest method podamShouldBeAbleToManufactureAnyTypeOfCollections.
@Test
@Title("Podam should be able to manufacture any type of Lists")
public void podamShouldBeAbleToManufactureAnyTypeOfCollections() throws Exception {
PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
UnsupportedCollectionInConstructorPojo<?> pojo = podamInvocationSteps.whenIInvokeTheFactoryForGenericTypeWithSpecificType(UnsupportedCollectionInConstructorPojo.class, podamFactory, String.class);
podamValidationSteps.thePojoMustBeOfTheType(pojo, UnsupportedCollectionInConstructorPojo.class);
podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getVector(), String.class);
}
use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.
the class ConstructorsUnitTest method podamShouldCreateInstancesOfJAXBElements.
@Test
@Title("Podam should be able to create instances of JAXBElement")
public void podamShouldCreateInstancesOfJAXBElements() throws Exception {
PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
JAXBElement<?> pojo = podamInvocationSteps.whenIInvokeTheFactoryForGenericTypeWithSpecificType(JAXBElement.class, podamFactory, String.class);
podamValidationSteps.thePojoMustBeOfTheType(pojo, JAXBElement.class);
podamValidationSteps.thePojoMustBeOfTheType(pojo.getName(), QName.class);
podamValidationSteps.thePojoMustBeOfTheType(pojo.getValue(), String.class);
}
Aggregations