boolean expectRandom) throws Exception {
boolean randomized = false;
String prevEndpoint = null;
for (int i = 0; i < 20; i++) {
feature.getTargetSelector().close();
WebClient bookStore = getWebClient(inactiveReplica, feature);
verifyStrategy(bookStore, expectRandom
? RandomStrategy.class
: SequentialStrategy.class);
String bookId = expectServerException ? "9999" : "123";
bookStore.path("bookstore/books").path(bookId);
Exception ex = null;
try {
Book book = bookStore.get(Book.class);
assertNotNull("expected non-null response", book);
assertEquals("unexpected id", 123L, book.getId());
} catch (Exception error) {
if (!expectServerException) {
throw error;