Add a TestUtils class and use it

Signed-off-by: Francis Galiegue <fgaliegue@gmail.com>