@Test public void parseBoxPlotSerieToSeries() { final String name = "test"; final List<Double[]> listOfDoubleArrays = Arrays.<Double[]>asList(new Double[] {0d, 0d, 0d, 0d, 0d}); BoxPlotSerie boxPlotSerie = mock(BoxPlotSerie.class); when(boxPlotSerie.getName()).thenReturn(name); when(boxPlotSerie.getData()).thenReturn(listOfDoubleArrays); Series series = highchartSeriesUtil.parseBoxPlotSerieToSeries(boxPlotSerie); assertEquals(series.getName(), name); assertEquals(series.getData(), listOfDoubleArrays); }
/** * Parse the boxPlotSerie to a Series object computable with the Highcharts box plot series * standard * * @param boxPlotSerie * @return series */ public Series parseBoxPlotSerieToSeries(BoxPlotSerie boxPlotSerie) { Series series = new Series(); series.setName(boxPlotSerie.getName()); series.setData(new ArrayList<Object>(boxPlotSerie.getData())); return series; }