@Test public void testPieChart() throws Exception { customizer.customize(getComponent(), new HashMap<>()); Exchange inbound = new DefaultExchange(createCamelContext()); GoogleChart model = new GoogleChart(); model.setSpreadsheetId(getSpreadsheetId()); model.setTitle("SyndesisPie"); model.setSheetId(0); GoogleChart.PieChart pieChart = new GoogleChart.PieChart(); pieChart.setDomainRange("A1:A5"); pieChart.setDataRange("B1:B5"); model.setPieChart(pieChart); 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(); PieChartSpec chartSpec = addChartRequest.getChart().getSpec().getPieChart(); Assert.assertNotNull(chartSpec); Assert.assertEquals("RIGHT_LEGEND", chartSpec.getLegendPosition()); Assert.assertEquals(1, chartSpec.getSeries().size()); ChartData domain = chartSpec.getDomain(); Assert.assertEquals(1, domain.getSourceRange().getSources().size()); GridRange domainRange = domain.getSourceRange().getSources().get(0); Assert.assertEquals(Integer.valueOf(0), domainRange.getStartRowIndex()); Assert.assertEquals(Integer.valueOf(5), domainRange.getEndRowIndex()); Assert.assertEquals(Integer.valueOf(0), domainRange.getStartColumnIndex()); Assert.assertEquals(Integer.valueOf(1), domainRange.getEndColumnIndex()); ChartData data = chartSpec.getSeries(); Assert.assertEquals(1, data.getSourceRange().getSources().size()); GridRange dataRange = data.getSourceRange().getSources().get(0); Assert.assertEquals(Integer.valueOf(0), dataRange.getStartRowIndex()); Assert.assertEquals(Integer.valueOf(5), dataRange.getEndRowIndex()); Assert.assertEquals(Integer.valueOf(1), dataRange.getStartColumnIndex()); Assert.assertEquals(Integer.valueOf(2), dataRange.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);  }