@Test public void testGetNextColorNull() { PowerMockito.mockStatic(JMeterUtils.class); PowerMockito.when(JMeterUtils.getProperty("jmeterPlugin.customColorsDispatcher")).thenReturn("custompalette"); PowerMockito.when(JMeterUtils.getProperty("jmeterPlugin.customColorsDispatcher.options")).thenReturn(null); ColorsDispatcher instance = ColorsDispatcherFactory.getColorsDispatcher(); for (int n = 0; n < 2000; n++) { Color c = instance.getNextColor(); System.out.println(c); Assert.assertNotNull(c); } }
@Override public Color getNextColor() { if (i + 1 > customPalette.size()) { reset(); return getNextColor(); } else { Color c = customPalette.get(i); log.debug("Custom color c next: " + c); i++; return c; } }
CustomPalette implements ColorsDispatcher { @Override public Color getNextColor() { if (i + 1 > customPalette.size()) { reset(); return getNextColor(); } else { Color c = customPalette.get(i); log.debug("Custom color c next: " + c); i++; return c; } } }
CustomPalette implements ColorsDispatcher { @Override public Color getNextColor() { if (i + 1 > customPalette.size()) { reset(); return getNextColor(); } else { Color c = customPalette.get(i); log.debug("Custom color c next: " + c); i++; return c; } } CustomPalette(String options); }
CustomPalette implements ColorsDispatcher { @Override public Color getNextColor() { if (i + 1 > customPalette.size()) { reset(); return getNextColor(); } else { Color c = customPalette.get(i); log.debug("Custom color c next: " + c); i++; return c; } } CustomPalette(String options); @Override void reset(); @Override Color getNextColor(); }
CustomPalette implements ColorsDispatcher { @Override public Color getNextColor() { if (i + 1 > customPalette.size()) { reset(); return getNextColor(); } else { Color c = customPalette.get(i); log.debug("Custom color c next: " + c); i++; return c; } } CustomPalette(String options); @Override void reset(); @Override Color getNextColor();  }