Source:
public void blacklistSupervisorWithAddedPort() { Config config = new Config(); config.putAll(Utils.readDefaultConfig()); config.put(DaemonConfig.BLACKLIST_SCHEDULER_TOLERANCE_TIME,10); config.put(DaemonConfig.BLACKLIST_SCHEDULER_TOLERANCE_COUNT,2); config.put(DaemonConfig.BLACKLIST_SCHEDULER_RESUME_TIME,300); StormMetricsRegistry metricsRegistry = new StormMetricsRegistry(); scheduler = new BlacklistScheduler(new DefaultScheduler(), metricsRegistry); scheduler.prepare(config); Map<String, TopologyDetails> topoMap = new HashMap<>(); TopologyDetails topo1 = TestUtilsForBlacklistScheduler.getTopology("topo-1", config, 5, 15, 1, 1, currentTime - 2,true); topoMap.put(topo1.getId(), topo1); Topologies topologies = new Topologies(topoMap); INimbus iNimbus = new TestUtilsForBlacklistScheduler.INimbusTest(); ResourceMetrics resourceMetrics = new ResourceMetrics(metricsRegistry); Map<String, SupervisorDetails> supMap = TestUtilsForBlacklistScheduler.genSupervisors(3,4); Cluster cluster = new Cluster(iNimbus, resourceMetrics, supMap, new HashMap<String, SchedulerAssignmentImpl>(), topologies, config); scheduler.schedule(topologies, cluster); cluster = new Cluster(iNimbus, resourceMetrics, TestUtilsForBlacklistScheduler.modifyPortFromSupervisors(supMap, "sup-0",4, true),TestUtilsForBlacklistScheduler.assignmentMapToImpl( cluster.getAssignments()), topologies, config); scheduler.schedule(topologies, cluster); cluster = new Cluster(iNimbus, resourceMetrics, TestUtilsForBlacklistScheduler.modifyPortFromSupervisors(supMap, "sup-0",4, false),TestUtilsForBlacklistScheduler.assignmentMapToImpl( cluster.getAssignments()), topologies, config); scheduler.schedule(topologies, cluster); }

Target:
public void blacklistSupervisorWithAddedPort() { Config config = new Config(); config.putAll(Utils.readDefaultConfig()); config.put(DaemonConfig.BLACKLIST_SCHEDULER_TOLERANCE_TIME,10); config.put(DaemonConfig.BLACKLIST_SCHEDULER_TOLERANCE_COUNT,2); config.put(DaemonConfig.BLACKLIST_SCHEDULER_RESUME_TIME,300); StormMetricsRegistry metricsRegistry = new StormMetricsRegistry(); scheduler = new BlacklistScheduler(new DefaultScheduler(), metricsRegistry); scheduler.prepare(config); Map<String, TopologyDetails> topoMap = new HashMap<>(); TopologyDetails topo1 = TestUtilsForBlacklistScheduler.getTopology("topo-1", config, 5, 15, 1, 1, currentTime - 2, true); topoMap.put(topo1.getId(), topo1); Topologies topologies = new Topologies(topoMap); INimbus iNimbus = new TestUtilsForBlacklistScheduler.INimbusTest(); ResourceMetrics resourceMetrics = new ResourceMetrics(metricsRegistry); Map<String, SupervisorDetails> supMap = TestUtilsForBlacklistScheduler.genSupervisors(3,4); Cluster cluster = new Cluster(iNimbus, resourceMetrics, supMap, new HashMap<String, SchedulerAssignmentImpl>(), topologies, config); scheduler.schedule(topologies, cluster); cluster = new Cluster(iNimbus, resourceMetrics, TestUtilsForBlacklistScheduler.addPortToSupervisors(supMap, "sup-0", 4),TestUtilsForBlacklistScheduler.assignmentMapToImpl( cluster.getAssignments()), topologies, config); scheduler.schedule(topologies, cluster); cluster = new Cluster(iNimbus, resourceMetrics, TestUtilsForBlacklistScheduler.removePortFromSupervisors(supMap, "sup-0", 4),TestUtilsForBlacklistScheduler.assignmentMapToImpl( cluster.getAssignments()), topologies, config); scheduler.schedule(topologies, cluster); }