Search in sources :

Example 1 with ImmutableNoHierarchicalAnnotatedPojo

use of uk.co.jemos.podam.test.dto.ImmutableNoHierarchicalAnnotatedPojo in project podam by devopsfolks.

the class AnnotationsTest method podamShouldHandleImmutablePojosAnnotatedWithPodamConstructor.

@Test
@Title("Podam should handle immutable POJOs annotated with @PodamConstructor")
public void podamShouldHandleImmutablePojosAnnotatedWithPodamConstructor() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
    ImmutableNoHierarchicalAnnotatedPojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(ImmutableNoHierarchicalAnnotatedPojo.class, podamFactory);
    podamValidationSteps.theObjectShouldNotBeNull(pojo);
    podamValidationSteps.theIntFieldShouldNotBeZero(pojo.getIntField());
    podamValidationSteps.thePojoMustBeOfTheType(pojo.getDateCreated(), GregorianCalendar.class);
    podamValidationSteps.thePojoMustBeOfTheType(pojo.getDateCreated().getTime(), Date.class);
    podamValidationSteps.theArrayOfTheGivenTypeShouldNotBeNullOrEmptyAndContainElementsOfTheRightType(pojo.getLongArray(), Long.class);
    podamValidationSteps.theLongValueShouldNotBeZero(pojo.getLongArray()[0]);
}
Also used : ImmutableNoHierarchicalAnnotatedPojo(uk.co.jemos.podam.test.dto.ImmutableNoHierarchicalAnnotatedPojo) PodamFactory(uk.co.jemos.podam.api.PodamFactory) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Aggregations

Title (net.thucydides.core.annotations.Title)1 Test (org.junit.Test)1 PodamFactory (uk.co.jemos.podam.api.PodamFactory)1 ImmutableNoHierarchicalAnnotatedPojo (uk.co.jemos.podam.test.dto.ImmutableNoHierarchicalAnnotatedPojo)1