Use the same way of assert isinstance in all tests

Change-Id: Ia0b0c2875183ccb588cebd480a4fcda7114915f2
Fix function name typo in persistence utils

Change-Id: Id34669d0fdaeba99e81b2bae55d529f81214e4fc
Proper exception raised from check_task_transition

* Used proper exception (InvalidStateException -> InvalidState) in
  the check_task_transition function.
* Added unit tests for the check_task_transition function.

Change-Id: I093c209ed77c69739ab92dd1426da6a94e8bd81a
Merge "Use the same way of assert isinstance in all tests"
Merge "Proper exception raised from check_task_transition"