Search in sources :

Example 6 with Step

use of net.thucydides.core.annotations.Step in project podam by devopsfolks.

the class PodamFactorySteps method givenAStandardPodamFactoryWithMemoizationEnabled.

@Step("Given a Standard Podam Factory with memoization enabled")
public PodamFactory givenAStandardPodamFactoryWithMemoizationEnabled() {
    PodamFactory podamFactory = givenAStandardPodamFactory();
    DataProviderStrategy strategyWithMemoization = givenADataProviderStrategyWithMemoizationSetToTrue();
    podamFactory.setStrategy(strategyWithMemoization);
    return podamFactory;
}
Also used : CustomRandomDataProviderStrategy(uk.co.jemos.podam.test.strategies.CustomRandomDataProviderStrategy) CustomDataProviderStrategy(uk.co.jemos.podam.test.unit.features.inheritance.CustomDataProviderStrategy) Step(net.thucydides.core.annotations.Step)

Example 7 with Step

use of net.thucydides.core.annotations.Step in project podam by devopsfolks.

the class PodamFactorySteps method givenADataProviderStrategyWithMemoizationSetToTrue.

@Step("Given a Random Data Provider Strategy with memoization set to true")
public DataProviderStrategy givenADataProviderStrategyWithMemoizationSetToTrue() {
    DataProviderStrategy strategy = new RandomDataProviderStrategyImpl();
    strategy.setMemoization(true);
    return strategy;
}
Also used : CustomRandomDataProviderStrategy(uk.co.jemos.podam.test.strategies.CustomRandomDataProviderStrategy) CustomDataProviderStrategy(uk.co.jemos.podam.test.unit.features.inheritance.CustomDataProviderStrategy) Step(net.thucydides.core.annotations.Step)

Example 8 with Step

use of net.thucydides.core.annotations.Step in project podam by devopsfolks.

the class PodamFactorySteps method givenAnAttributeMetadataForEnums.

@Step("Given an Attribute Meta Data object for Enums")
public AttributeMetadata givenAnAttributeMetadataForEnums(Class<?> pojoClass, Object pojoInstance) {
    if (null == pojoClass) {
        throw new IllegalArgumentException("pojoClass cannot be null");
    }
    String attributeName = null;
    Class<?> realAttributeType = pojoClass;
    Type realGenericType = pojoClass;
    Type[] genericTypeArgs = new Type[0];
    List<Annotation> annotations = Collections.emptyList();
    AttributeMetadata attributeMetadata = new AttributeMetadata(attributeName, realAttributeType, realGenericType, genericTypeArgs, annotations, pojoClass, pojoInstance);
    return attributeMetadata;
}
Also used : Type(java.lang.reflect.Type) Annotation(java.lang.annotation.Annotation) Step(net.thucydides.core.annotations.Step)

Example 9 with Step

use of net.thucydides.core.annotations.Step in project podam by devopsfolks.

the class PodamStrategySteps method addOrReplaceSpecific.

@Step("When I add a specific type {2} for an abstract type or interface {1}")
public <T> void addOrReplaceSpecific(PodamFactory podamFactory, Class<T> abstractType, Class<? extends T> concreteType) {
    DataProviderStrategy strategy = podamFactory.getStrategy();
    strategy.addOrReplaceSpecific(abstractType, concreteType);
}
Also used : DataProviderStrategy(uk.co.jemos.podam.api.DataProviderStrategy) Step(net.thucydides.core.annotations.Step)

Example 10 with Step

use of net.thucydides.core.annotations.Step in project podam by devopsfolks.

the class RecursivePojoValidationSteps method allPojosInTheRecursiveStrategyShouldBeValid.

@Step("Then all the POJOs in the recursive hierarchy should be valid")
public void allPojosInTheRecursiveStrategyShouldBeValid(RecursivePojo pojo) {
    assertThat("The integer value in the pojo should not be zero!", pojo.getIntField(), not(equalTo(0)));
    RecursivePojo parentPojo = pojo.getParent();
    assertThat("The parent pojo cannot be null!", parentPojo, not(nullValue()));
    assertThat("The integer value in the parent pojo should not be zero!", parentPojo.getIntField(), not(equalTo(0)));
    assertThat("The parent attribute of the parent pojo cannot be null!", parentPojo.getParent(), not(nullValue()));
}
Also used : RecursivePojo(uk.co.jemos.podam.test.dto.RecursivePojo) Step(net.thucydides.core.annotations.Step)

Aggregations

Step (net.thucydides.core.annotations.Step)12 Annotation (java.lang.annotation.Annotation)2 Type (java.lang.reflect.Type)2 Calendar (java.util.Calendar)2 DataProviderStrategy (uk.co.jemos.podam.api.DataProviderStrategy)2 CustomRandomDataProviderStrategy (uk.co.jemos.podam.test.strategies.CustomRandomDataProviderStrategy)2 CustomDataProviderStrategy (uk.co.jemos.podam.test.unit.features.inheritance.CustomDataProviderStrategy)2 BigDecimal (java.math.BigDecimal)1 Date (java.util.Date)1 HashSet (java.util.HashSet)1 Random (java.util.Random)1 HttpResponse (org.apache.http.HttpResponse)1 ClassAttribute (uk.co.jemos.podam.api.ClassAttribute)1 RecursivePojo (uk.co.jemos.podam.test.dto.RecursivePojo)1 Address (uk.co.jemos.podam.test.dto.docs.example.Address)1 BankAccount (uk.co.jemos.podam.test.dto.docs.example.BankAccount)1 Order (uk.co.jemos.podam.test.dto.docs.example.Order)1 OrderItem (uk.co.jemos.podam.test.dto.docs.example.OrderItem)1