Add test cases for extractTarget

Test situation where the local domain is specified.

Change-Id: Ic27c3c8b1bd80b7f60bf90b1f20238420b43dbff