use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.
the class ExternalFactoryUnitTest method podamShouldFillPojoInterfaceAttributeIfFullConstructorSetsItsValue.
@Test
@Title("Podam should fill POJOs and interface attributes if a full constructor sets the interface attribute value")
public void podamShouldFillPojoInterfaceAttributeIfFullConstructorSetsItsValue() throws Exception {
TestExternalFactory externalFactory = (TestExternalFactory) podamFactorySteps.givenAnExternalFactory();
PodamFactory podamFactory = podamFactorySteps.givenAdPodamFactoryWithExternalFactory(externalFactory);
podamValidationSteps.theTwoObjectsShouldBeEqual(podamFactory.getExternalFactory(), externalFactory);
PojoWithInterfaces pojo = podamInvocationSteps.whenIInvokeTheFactoryForClassWithFullConstructor(PojoWithInterfaces.class, podamFactory);
podamValidationSteps.theObjectShouldNotBeNull(pojo);
podamValidationSteps.theTwoObjectsShouldBeEqual(2, externalFactory.getFailures().size());
podamValidationSteps.theTwoObjectsShouldBeEqual(ObjectExt.class, externalFactory.getFailures().get(0));
podamValidationSteps.theTwoObjectsShouldBeEqual(InterfacePojo.class, externalFactory.getFailures().get(1));
podamValidationSteps.theTwoObjectsShouldBeEqual(2, externalFactory.getFullDataCalls().size());
}
use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.
the class ExternalFactoryUnitTest method podamShouldNotcreateInstancesOfNonInstantiableClasses.
@Test
@Title("Podam should not create instances of non-instantiable classes")
public void podamShouldNotcreateInstancesOfNonInstantiableClasses() throws Exception {
TestExternalFactory externalFactory = (TestExternalFactory) podamFactorySteps.givenAnExternalFactory();
PodamFactory podamFactory = podamFactorySteps.givenAdPodamFactoryWithExternalFactory(externalFactory);
podamValidationSteps.theTwoObjectsShouldBeEqual(podamFactory.getExternalFactory(), externalFactory);
NonInstantiatableClass pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(NonInstantiatableClass.class, podamFactory);
podamValidationSteps.theObjectShouldBeNull(pojo);
podamValidationSteps.theTwoObjectsShouldBeEqual(1, externalFactory.getFailures().size());
podamValidationSteps.theTwoObjectsShouldBeEqual(NonInstantiatableClass.class, externalFactory.getFailures().get(0));
podamValidationSteps.theTwoObjectsShouldBeEqual(0, externalFactory.getFullDataCalls().size());
}
use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.
the class XMLDatatypeUnitTest method testDurationManufacturing.
@Test
@Title("When given an external factory, Podam should be able to create instances of the Duration class")
public void testDurationManufacturing() throws Exception {
PodamFactory podamFactory = podamFactorySteps.givenAPodamFactoryWithXmlTypesExternalFactory();
Duration pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(Duration.class, podamFactory);
podamValidationSteps.theObjectShouldNotBeNull(pojo);
}
use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.
the class Pdm43UnitTest method validateDtoInstantiation.
@Test
public void validateDtoInstantiation() {
PodamFactory podamFactory = new PodamFactoryImpl();
ConcreteBusinessObject pojo = podamFactory.manufacturePojo(ConcreteBusinessObject.class);
Assert.assertNotNull("The created POJO cannot be null!", pojo);
}
use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.
the class WalkThroughExampleUnitTest method testArticleSetup.
@Test
@Title("Podam should fill the Article POJO correctly")
public void testArticleSetup() throws Exception {
PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
Article pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(Article.class, podamFactory);
walkThroughSteps.theArticlePojoShouldBeCorrectlyFilled(pojo);
}
Aggregations