Make sure preference isn't null

This commit is contained in:
Martijn van Groningen 2013-08-27 11:05:12 +02:00
parent db46946d16
commit 45699bae5a
1 changed files with 7 additions and 0 deletions

View File

@ -333,9 +333,16 @@ public class RecoveryPercolatorTests extends AbstractNodesTests {
String preference;
if (node2Id == null && node3Id == null) {
preference = "_local";
} else if (node2Id == null || node3Id == null) {
if (node2Id != null) {
preference = "_prefer_node:" + node2Id;
} else {
preference = "_prefer_node:" + node3Id;
}
} else {
preference = "_prefer_node:" + (randomBoolean() ? node2Id : node3Id);
}
if (multiPercolate) {
MultiPercolateRequestBuilder builder = client
.prepareMultiPercolate();