use of uk.co.jemos.podam.test.dto.SimplePojoToTestSetters in project podam by devopsfolks.
the class MemoizationTest method whenMemoizationIsFalsePodamShouldReturnDifferentInstancesForDifferentInvocations.
@Test
@Title("When memoization is set to false Podam should return different instances for different invocations")
public void whenMemoizationIsFalsePodamShouldReturnDifferentInstancesForDifferentInvocations() throws Exception {
PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
podamFactory.getStrategy().setMemoization(false);
podamValidationSteps.theMemoizationShouldBeEnabled(podamFactory.getStrategy(), false);
SimplePojoToTestSetters pojo1 = podamInvocationSteps.whenIInvokeTheFactoryForClass(SimplePojoToTestSetters.class, podamFactory);
podamValidationSteps.thePojoMustBeOfTheType(pojo1, SimplePojoToTestSetters.class);
SimplePojoToTestSetters pojo2 = podamInvocationSteps.whenIInvokeTheFactoryForClass(SimplePojoToTestSetters.class, podamFactory);
podamValidationSteps.thePojoMustBeOfTheType(pojo2, SimplePojoToTestSetters.class);
podamValidationSteps.theTwoObjectsShouldBeDifferent(pojo1, pojo2);
}
use of uk.co.jemos.podam.test.dto.SimplePojoToTestSetters in project podam by devopsfolks.
the class PodamFactoryInjectionIntegrationTest method testSimplePojo.
@Test
public void testSimplePojo() {
SimplePojoToTestSetters pojo = factory.manufacturePojo(SimplePojoToTestSetters.class);
assertThat("The pojo cannot be null!", pojo, not(nullValue()));
int intField = pojo.getIntField();
assertThat("The int field cannot be zero!", intField, not(equalTo(0)));
String stringField = pojo.getStringField();
assertThat("The string field cannot be null!", stringField, not(nullValue()));
}
use of uk.co.jemos.podam.test.dto.SimplePojoToTestSetters in project podam by devopsfolks.
the class MemoizationTest method whenMemoizationIsTruePodamShouldReturnTheSameInstanceForDifferentInvocations.
@Test
@Title("When memoization is set to true Podam should return the same instance for different invocations")
public void whenMemoizationIsTruePodamShouldReturnTheSameInstanceForDifferentInvocations() throws Exception {
PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactoryWithMemoizationEnabled();
podamValidationSteps.theMemoizationShouldBeEnabled(podamFactory.getStrategy(), true);
SimplePojoToTestSetters pojo1 = podamInvocationSteps.whenIInvokeTheFactoryForClass(SimplePojoToTestSetters.class, podamFactory);
podamValidationSteps.thePojoMustBeOfTheType(pojo1, SimplePojoToTestSetters.class);
SimplePojoToTestSetters pojo2 = podamInvocationSteps.whenIInvokeTheFactoryForClass(SimplePojoToTestSetters.class, podamFactory);
podamValidationSteps.thePojoMustBeOfTheType(pojo2, SimplePojoToTestSetters.class);
podamValidationSteps.theTwoObjectsShouldBeStrictlyEqual(pojo1, pojo2);
}
Aggregations