Refactoring ProcessInstance tests

IN-391 IN-266