use of uk.co.jemos.podam.api.DataProviderStrategy in project podam by devopsfolks.
the class PodamFactoryBasicTypesTest method podamShouldSupportCircularDependenciesCustomDepth.
@Test
@Title("Podam should fill in POJOs which have a circular dependency and custom depth")
public void podamShouldSupportCircularDependenciesCustomDepth() throws Exception {
DataProviderStrategy strategy = podamFactorySteps.givenACustomDataProviderStrategy();
PodamFactory podamFactory = podamFactorySteps.givenAPodamFactoryWithCustomDataProviderStrategy(strategy);
createPojoWithCircularDependencies(podamFactory);
}
use of uk.co.jemos.podam.api.DataProviderStrategy in project podam by devopsfolks.
the class RandomDataProviderStrategyImplInitialisationUnitTest method podamShouldCorrectGenerateHashMapsWithLongAsKeyType.
@Test
@Title("Podam should correctly generate HashMaps with Long as key type")
public void podamShouldCorrectGenerateHashMapsWithLongAsKeyType() throws Exception {
DataProviderStrategy strategy = podamFactorySteps.givenACustomRandomDataProviderStrategy();
PodamFactory podamFactory = podamFactorySteps.givenAPodamFactoryWithCustomDataProviderStrategy(strategy);
Map<?, ?> pojo = podamInvocationSteps.whenIInvokeTheFactoryForGenericTypeWithSpecificType(HashMap.class, podamFactory, Long.class, String.class);
podamValidationSteps.theObjectShouldNotBeNull(pojo);
podamValidationSteps.theTwoObjectsShouldBeEqual(strategy.getNumberOfCollectionElements(String.class), pojo.size());
}
use of uk.co.jemos.podam.api.DataProviderStrategy in project podam by devopsfolks.
the class MultipleInterfacesInheritanceTest method provideCustomisedPodamFactory.
// -------------> Private methods
private PodamFactory provideCustomisedPodamFactory() throws Exception {
TrackingExternalFactory externalFactory = podamFactorySteps.givenATrackingExternalFactory();
DataProviderStrategy customDataProviderStrategy = podamFactorySteps.givenACustomDataProviderStrategy();
PodamFactory podamFactory = podamFactorySteps.givenAPodamFactoryWithExternalFactoryAndCustomStrategy(externalFactory, customDataProviderStrategy);
return podamFactory;
}
use of uk.co.jemos.podam.api.DataProviderStrategy in project podam by devopsfolks.
the class PodamStrategySteps method removeSpecific.
@Step("When I remove a specific type {1} for an abstract type or interface")
public <T> void removeSpecific(PodamFactory podamFactory, Class<T> abstractType) {
DataProviderStrategy strategy = podamFactory.getStrategy();
strategy.removeSpecific(abstractType);
}
use of uk.co.jemos.podam.api.DataProviderStrategy in project podam by devopsfolks.
the class PodamFactoryBasicTypesTest method podamShouldFillRecursivePojosWithLists.
@Test
@Title("Podam should fill recursive POJOs correctly, including all their list fields")
public void podamShouldFillRecursivePojosWithLists() throws Exception {
DataProviderStrategy strategy = podamFactorySteps.givenACustomDepthDataProviderStrategy();
PodamFactory podamFactory = podamFactorySteps.givenAPodamFactoryWithCustomDataProviderStrategy(strategy);
RecursivePojoWithList recursivePojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(RecursivePojoWithList.class, podamFactory);
podamValidationSteps.thePojoMustBeOfTheType(recursivePojo, RecursivePojoWithList.class);
podamValidationSteps.thePojoMustBeOfTheType(recursivePojo.getRelated(), RecursivePojoWithList.class);
podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(recursivePojo.getChildren(), RecursivePojoWithList.class);
for (RecursivePojoWithList child : recursivePojo.getChildren()) {
podamValidationSteps.thePojoShouldBeNull(child.getRelated());
podamValidationSteps.theCollectionShouldBeEmpty(child.getChildren());
}
}
Aggregations