@Test public void testBarChartWithMultipleSeries() throws Exception { customizer.customize(getComponent(), new HashMap<>()); Exchange inbound = new DefaultExchange(createCamelContext()); GoogleChart model = new GoogleChart(); model.setSpreadsheetId(getSpreadsheetId()); model.setTitle("SyndesisBars"); model.setSheetId(0); GoogleChart.BasicChart basicChart = new GoogleChart.BasicChart(); basicChart.setAxisTitleBottom("Product Names"); basicChart.setAxisTitleLeft("Sales Numbers"); basicChart.setDomainRange("A1:A10"); basicChart.setDataRange("B1:B10,C1:C10"); model.setBasicChart(basicChart); inbound.getIn().setBody(model); getComponent().getBeforeProducer().process(inbound); BatchUpdateSpreadsheetRequest batchUpdateRequest = (BatchUpdateSpreadsheetRequest) inbound.getIn().getHeader(GoogleSheetsConstants.PROPERTY_PREFIX + "batchUpdateSpreadsheetRequest"); Assert.assertEquals(1, batchUpdateRequest.getRequests().size()); AddChartRequest addChartRequest = batchUpdateRequest.getRequests().get(0).getAddChart(); Assert.assertTrue(addChartRequest.getChart().getPosition().getNewSheet()); BasicChartSpec chartSpec = addChartRequest.getChart().getSpec().getBasicChart(); Assert.assertNotNull(chartSpec); Assert.assertEquals(2, chartSpec.getSeries().size()); Assert.assertEquals("LEFT_AXIS", chartSpec.getSeries().get(0).getTargetAxis()); BasicChartSeries basicChartSeries = chartSpec.getSeries().get(0); Assert.assertEquals(1, basicChartSeries.getSeries().getSourceRange().getSources().size()); GridRange gridRange = basicChartSeries.getSeries().getSourceRange().getSources().get(0); Assert.assertEquals(Integer.valueOf(0), gridRange.getStartRowIndex()); Assert.assertEquals(Integer.valueOf(10), gridRange.getEndRowIndex()); Assert.assertEquals(Integer.valueOf(1), gridRange.getStartColumnIndex()); Assert.assertEquals(Integer.valueOf(2), gridRange.getEndColumnIndex()); Assert.assertEquals("LEFT_AXIS", chartSpec.getSeries().get(1).getTargetAxis()); basicChartSeries = chartSpec.getSeries().get(1); Assert.assertEquals(1, basicChartSeries.getSeries().getSourceRange().getSources().size()); gridRange = basicChartSeries.getSeries().getSourceRange().getSources().get(0); Assert.assertEquals(Integer.valueOf(0), gridRange.getStartRowIndex()); Assert.assertEquals(Integer.valueOf(10), gridRange.getEndRowIndex()); Assert.assertEquals(Integer.valueOf(2), gridRange.getStartColumnIndex()); Assert.assertEquals(Integer.valueOf(3), gridRange.getEndColumnIndex()); }
@Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); }
GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } }
GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); }  }
GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); }  @Override void customize(ComponentProxyComponent component, Map<String, Object> options); }
GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); }  @Override void customize(ComponentProxyComponent component, Map<String, Object> options);  }