I tried to create test for the following method;
public ValidationResult getValidationResult(String a){
return MyFactory.getValidatorInstance(a).validate();
}
getValidatorInstance method is a static method inside my factory class and returns an interface instance according to parameter.
Basically i want to test getValidationResult and having misusing errors and i am not sure if the static method is the problem. What is the correct way to achieve this ?
I tried to mock MyFactory and Validator interface and tried to add condition for getValidatorInstane method to return MatrixValidator when() it is called