Skip to content

Complex object as param #66

@dtamajon

Description

@dtamajon

Hi again Anuj,

I have been testing with easytest on "basic" way, and now I'm trying to test passing a complex object as parameter.

For example:

@dataloader(filePaths = { "myXmlData.xml" })
testSave_withMyEntity(MyEntity myEntity){
myBo.save(myEntity);
}

And myXmlData.xml contains:
<TestMethod name="testSave_withMyEntity">
    <TestRecord id="1">
        <Description></Description>
        <InputData>
            <Entry key="name" value="Administrador" />
            <Entry key="description" value="" />
            <Entry key="state" value="true" />
            <Entry key="value" value="8" />
        </InputData>
    </TestRecord>
</TestMethod>

When I test with JUnit, it shows the method with the given parameters in XML
testSave_withMyEntity{name=Administrador,description=,state=true,value=8}, but it does not make the instance of 'MyEntity', so test is failing.

What am I missing?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions