mirror of https://github.com/apache/lucene.git
SOLR-6220: Fixes forbidden method invocation String#getBytes() in RuleEngineTest
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1677622 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c427526bcd
commit
1ed601dfed
|
@ -18,6 +18,7 @@ package org.apache.solr.cloud.rule;
|
|||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
@ -60,7 +61,7 @@ public class RuleEngineTest extends SolrTestCaseJ4{
|
|||
" 'node':'127.0.0.1:49958_'," +
|
||||
" 'disk':992," +
|
||||
" 'cores':1}}";
|
||||
MockSnitch.nodeVsTags = (Map) ZkStateReader.fromJSON(s.getBytes());
|
||||
MockSnitch.nodeVsTags = (Map) ZkStateReader.fromJSON(s.getBytes(StandardCharsets.UTF_8));
|
||||
Map shardVsReplicaCount = makeMap("shard1", 2, "shard2", 2);
|
||||
|
||||
List<Rule> rules = parseRules("[{'cores':'<4'}, {" +
|
||||
|
@ -105,7 +106,7 @@ public class RuleEngineTest extends SolrTestCaseJ4{
|
|||
" 'node':'127.0.0.1:49958_'," +
|
||||
" 'disk':970," +
|
||||
" 'cores':1}}";
|
||||
MockSnitch.nodeVsTags = (Map) ZkStateReader.fromJSON(s.getBytes());
|
||||
MockSnitch.nodeVsTags = (Map) ZkStateReader.fromJSON(s.getBytes(StandardCharsets.UTF_8));
|
||||
//test not
|
||||
List<Rule> rules = parseRules(
|
||||
"[{cores:'<4'}, " +
|
||||
|
@ -182,7 +183,7 @@ public class RuleEngineTest extends SolrTestCaseJ4{
|
|||
|
||||
private List<Rule> parseRules(String s) {
|
||||
|
||||
List maps = (List) ZkStateReader.fromJSON(s.getBytes());
|
||||
List maps = (List) ZkStateReader.fromJSON(s.getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
List<Rule> rules = new ArrayList<>();
|
||||
for (Object map : maps) rules.add(new Rule((Map) map));
|
||||
|
|
Loading…
Reference in New Issue