Search in sources :

Example 1 with AttributeMetadata

use of uk.co.jemos.podam.api.AttributeMetadata in project podam by devopsfolks.

the class TypeManufacturingTest method produceValueForType.

private Object produceValueForType(Class<?> attributeType) {
    DataProviderStrategy dataProviderStrategy = podamFactorySteps.givenARandomDataProviderStrategy();
    Object pojoInstance = null;
    AttributeMetadata attributeMetadata = podamFactorySteps.givenAnAttributeMetadata(SimplePojoToTestSetters.class, pojoInstance, attributeType);
    podamValidationSteps.theObjectShouldNotBeNull(attributeMetadata);
    Map<String, Type> genericTypeArgumentsMap = new HashMap<String, Type>();
    return podamInvocationSteps.whenISendAMessageToTheChannel(dataProviderStrategy, attributeMetadata, genericTypeArgumentsMap, attributeType);
}
Also used : Type(java.lang.reflect.Type) DataProviderStrategy(uk.co.jemos.podam.api.DataProviderStrategy) HashMap(java.util.HashMap) AttributeMetadata(uk.co.jemos.podam.api.AttributeMetadata)

Example 2 with AttributeMetadata

use of uk.co.jemos.podam.api.AttributeMetadata in project podam by devopsfolks.

the class TypeManufacturingTest method podamMessagingSystemShouldReturnAnEnumValue.

@Test
@Title("Podam Messaging System should return an Enum value")
public void podamMessagingSystemShouldReturnAnEnumValue() throws Exception {
    DataProviderStrategy dataProviderStrategy = podamFactorySteps.givenARandomDataProviderStrategy();
    Object pojoInstance = null;
    AttributeMetadata attributeMetadata = podamFactorySteps.givenAnAttributeMetadataForEnums(ExternalRatePodamEnum.class, pojoInstance);
    podamValidationSteps.theObjectShouldNotBeNull(attributeMetadata);
    Map<String, Type> genericTypeArgumentsMap = new HashMap<String, Type>();
    Object payload = podamInvocationSteps.whenISendAMessageToTheChannel(dataProviderStrategy, attributeMetadata, genericTypeArgumentsMap, ExternalRatePodamEnum.class.getSuperclass());
    podamValidationSteps.theObjectShouldNotBeNull(payload);
}
Also used : Type(java.lang.reflect.Type) DataProviderStrategy(uk.co.jemos.podam.api.DataProviderStrategy) HashMap(java.util.HashMap) AttributeMetadata(uk.co.jemos.podam.api.AttributeMetadata) ExternalRatePodamEnum(uk.co.jemos.podam.test.enums.ExternalRatePodamEnum) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Aggregations

Type (java.lang.reflect.Type)2 HashMap (java.util.HashMap)2 AttributeMetadata (uk.co.jemos.podam.api.AttributeMetadata)2 DataProviderStrategy (uk.co.jemos.podam.api.DataProviderStrategy)2 Title (net.thucydides.core.annotations.Title)1 Test (org.junit.Test)1 ExternalRatePodamEnum (uk.co.jemos.podam.test.enums.ExternalRatePodamEnum)1