Skip to content
Permalink
Browse files
HELIX-1233: fix broken test in helix view aggregator module
RB=1388194
BUG=HELIX-1233
G=helix-reviewers
R=jxue,lxia,jjwang,hulee
A=lxia
  • Loading branch information
zhan849 authored and junkaixue committed Apr 11, 2022
1 parent 109717c commit 258f49a8ddf6b345bc0cde840e10f99eaf9b1704
Showing 1 changed file with 19 additions and 0 deletions.
@@ -30,9 +30,27 @@

public class MockSourceClusterDataProvider extends SourceClusterDataProvider {

static class MockExternalViewCache extends ExternalViewCache {

public MockExternalViewCache(String clusterName) {
super(clusterName);
}

public void setExternalView(List<ExternalView> externalViews) {
Map<String, ExternalView> evMap = new HashMap<>();
for (ExternalView ev : externalViews) {
evMap.put(ev.getId(), ev);
}
// Set _externalViewMap instead of _externalViewCache as we serve ExternalViewCache
// APIs using data inside the map
_externalViewMap = evMap;
}
}

public MockSourceClusterDataProvider(ViewClusterSourceConfig config,
ClusterEventProcessor processor) {
super(config, processor);
_externalViewCache = new MockExternalViewCache("Test");
}

@Override
@@ -80,5 +98,6 @@ public void setExternalViews(List<ExternalView> externalViewList) {
for (ExternalView ev : externalViewList) {
_externalViewMap.put(ev.getResourceName(), ev);
}
((MockExternalViewCache) _externalViewCache).setExternalView(externalViewList);
}
}

0 comments on commit 258f49a

Please sign in to comment.