refactor tests

Change-Id: Ifebc62ac52148d76077ff7d58d95d47cc5c8f187
Reviewed-on: http://review.couchbase.org/24021
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>