@Test public void testOverrideView() { final View view = new View(); view.setPartitions(""); view.setTopic("MyTopic"); view.setResultsPerPartition(10); final ConsumeRequest consumeRequest = new ConsumeRequest(); consumeRequest.setPartitions("2,3"); consumeRequest.setResultsPerPartition(100); final ViewCustomizer viewCustomizer = new ViewCustomizer(view, consumeRequest); viewCustomizer.overrideViewSettings(); assertEquals("Should have 100 results per partition", 100, (int) view.getResultsPerPartition()); assertEquals("should have partitions 2 and 3", "2,3", view.getPartitions()); assertEquals("should have partitions 2 and 3", 2, view.getPartitionsAsSet().size()); assertTrue("should have partitions 2 and 3", view.getPartitionsAsSet().contains(2)); assertTrue("should have partitions 2 and 3", view.getPartitionsAsSet().contains(3)); }
public View overrideViewSettings() { overrideResultPerPartition(); overridePartitions(); return view; }
ViewCustomizer { public View overrideViewSettings() { overrideResultPerPartition(); overridePartitions(); return view; } }
ViewCustomizer { public View overrideViewSettings() { overrideResultPerPartition(); overridePartitions(); return view; } ViewCustomizer(final View view, final ConsumeRequest consumeRequest); }
ViewCustomizer { public View overrideViewSettings() { overrideResultPerPartition(); overridePartitions(); return view; } ViewCustomizer(final View view, final ConsumeRequest consumeRequest); View overrideViewSettings(); List<FilterDefinition> getFilterDefinitions(); StartingPosition getStartingPosition(); }
ViewCustomizer { public View overrideViewSettings() { overrideResultPerPartition(); overridePartitions(); return view; } ViewCustomizer(final View view, final ConsumeRequest consumeRequest); View overrideViewSettings(); List<FilterDefinition> getFilterDefinitions(); StartingPosition getStartingPosition();  }