restapi: duplicate code in export domain tests

Removed duplicated code where the if and else branches are identical.

Change-Id: I22c496c8957a86d8fc5d915c552218c9fe5943a6
Signed-off-by: Allon Mureinik <amureini@redhat.com>