Hi,
I have a method written in service class which takes DSRequest as a input parmeter. In that method I am using the following code snippet to populate my DTO.
MyClient client = new MyClient();
dsRequest.getDataSource().setProperties(dsRequest.getValues(), client);
where client is a DTO object.
Now, I am not able to write a Junit test case for this method, as I dont know how to populate DataSource in DSRequest.
In my Junit test case I am creating DSRequest object as
DSRequest dsRequest = new DSRequest();
Please tell me how to populate DataSource object in DSRequest or else is there any better approach to Unit test my service class. I am using JUnit 4.0
I have a method written in service class which takes DSRequest as a input parmeter. In that method I am using the following code snippet to populate my DTO.
MyClient client = new MyClient();
dsRequest.getDataSource().setProperties(dsRequest.getValues(), client);
where client is a DTO object.
Now, I am not able to write a Junit test case for this method, as I dont know how to populate DataSource in DSRequest.
In my Junit test case I am creating DSRequest object as
DSRequest dsRequest = new DSRequest();
Please tell me how to populate DataSource object in DSRequest or else is there any better approach to Unit test my service class. I am using JUnit 4.0
Comment