Delete duplicated code from router tests

Reorganize duplicate code in a mixin for factorization purpose.

Change-Id: Ie5212a487a4e82c3b5e8808e04044ec38383e115
Merge "Delete duplicated code from router tests"