@Override
    public void transform(Message message, DataType fromType, DataType toType) {
        final Optional<ValueRange> valueRange = getValueRangeBody(message);

        String range = message.getHeader(GoogleSheetsConstants.PROPERTY_PREFIX + "range", "A:A").toString();
        String majorDimension = message
                .getHeader(GoogleSheetsConstants.PROPERTY_PREFIX + "majorDimension", RangeCoordinate.DIMENSION_ROWS).toString();
        String spreadsheetId = message.getHeader(GoogleSheetsConstants.PROPERTY_PREFIX + "spreadsheetId", "").toString();
        String[] columnNames
                = message.getHeader(GoogleSheetsConstants.PROPERTY_PREFIX + "columnNames", "A").toString().split(",");

        boolean splitResults = Boolean
                .parseBoolean(message.getHeader(GoogleSheetsConstants.PROPERTY_PREFIX + "splitResults", "false").toString());

        if (valueRange.isPresent()) {
            message.setBody(
                    transformFromValueRangeModel(message, valueRange.get(), spreadsheetId, range, majorDimension, columnNames));
        } else if (splitResults) {
            message.setBody(transformFromSplitValuesModel(message, spreadsheetId, range, majorDimension, columnNames));
        } else {
            String valueInputOption
                    = message.getHeader(GoogleSheetsConstants.PROPERTY_PREFIX + "valueInputOption", "USER_ENTERED").toString();
            message.setBody(
                    transformToValueRangeModel(message, spreadsheetId, range, majorDimension, valueInputOption, columnNames));
        }
    }
@Test
    public void testTransformToValueRangeRowDimension() throws Exception {
        Exchange inbound = new DefaultExchange(camelContext);
        inbound.getMessage().setHeader(GoogleSheetsConstants.PROPERTY_PREFIX + "range", "A1:B1");

        String model = "{" +
                       "\"spreadsheetId\": \"" + spreadsheetId + "\"," +
                       "\"A\": \"a1\"," +
                       "\"B\": \"b1\"" +
                       "}";
        inbound.getMessage().setBody(model);

        transformer.transform(inbound.getMessage(), DataType.ANY, DataType.ANY);

        Assertions.assertEquals(spreadsheetId, inbound.getMessage().getHeader(GoogleSheetsStreamConstants.SPREADSHEET_ID));
        Assertions.assertEquals("A1:B1", inbound.getMessage().getHeader(GoogleSheetsStreamConstants.RANGE));
        Assertions.assertEquals(RangeCoordinate.DIMENSION_ROWS,
                inbound.getMessage().getHeader(GoogleSheetsStreamConstants.MAJOR_DIMENSION));
        Assertions.assertEquals("USER_ENTERED",
                inbound.getMessage().getHeader(GoogleSheetsConstants.PROPERTY_PREFIX + "valueInputOption"));

        ValueRange valueRange = (ValueRange) inbound.getMessage().getHeader(GoogleSheetsConstants.PROPERTY_PREFIX + "values");
        Assertions.assertEquals(1L, valueRange.getValues().size());
        Assertions.assertEquals("a1", valueRange.getValues().get(0).get(0));
        Assertions.assertEquals("b1", valueRange.getValues().get(0).get(1));
    }