package org.apache.camel.spring.boot.issues;

import java.util.ArrayList;
import java.util.List;

import org.apache.camel.EndpointInject;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@EnableAutoConfiguration
@SpringBootTest(classes = {SimpleOgnlTest.class})
public class SimpleOgnlTest {
	@EndpointInject(uri = "mock:result")
    protected MockEndpoint resultEndpoint;
 
    @Produce(uri = "direct:start")
    protected ProducerTemplate template;
    
	@Test
    public void testSimpleOgnlListExpression() throws Exception {
		List<String> list = new ArrayList<String>();
		list.add("one");
		list.add("two");
 
        resultEndpoint.expectedBodiesReceived(list.get(0));
 
        template.sendBody(list);
 
        resultEndpoint.assertIsSatisfied();
    }
	
	@Configuration
    public static class ContextConfig {
        @Bean
        public RouteBuilder route() {
            return new RouteBuilder() {
                public void configure() {
                    from("direct:start").setBody(simple("${body[0]}")).to("mock:result");
                }
            };
        }
    }
}

@@ -1,8 +1,812 @@
+/**%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A
 package 
@@ -1553,16 +1553,17 @@
 sses = %7B
+ 
 SimpleOg
@@ -1574,16 +1574,17 @@
 st.class
+ 
 %7D)%0Apubli
@@ -1642,28 +1642,25 @@
 ck:result%22)%0A
-    
+%09
 protected Mo
@@ -1686,22 +1686,18 @@
 dpoint;%0A
- %0A    
+%0A%09
 @Produce
@@ -1719,20 +1719,17 @@
 start%22)%0A
-    
+%09
 protecte
@@ -1761,20 +1761,16 @@
 te;%0A
-    
 %0A%09@Test%0A
     
@@ -1765,20 +1765,17 @@
 %0A%09@Test%0A
-    
+%09
 public v
@@ -1913,26 +1913,19 @@
 %22two%22);%0A
- %0A        
+%0A%09%09
 resultEn
@@ -1968,26 +1968,19 @@
 et(0));%0A
- %0A        
+%0A%09%09
 template
@@ -2000,18 +2000,11 @@
 t);%0A
- %0A        
+%0A%09%09
 resu
@@ -2039,15 +2039,11 @@
 ();%0A
-    
+%09
 %7D%0A
-%09
 %0A%09@C
@@ -2055,20 +2055,17 @@
 uration%0A
-    
+%09
 public s
@@ -2096,30 +2096,18 @@
 g %7B%0A
-        @Bean%0A        
+%09%09@Bean%0A%09%09
 publ
@@ -2132,28 +2132,19 @@
 ute() %7B%0A
-            
+%09%09%09
 return n
@@ -2163,32 +2163,20 @@
 der() %7B%0A
-                
+%09%09%09%09
 public v
@@ -2197,28 +2197,13 @@
 ) %7B%0A
-                    
+%09%09%09%09%09
 from
@@ -2272,55 +2272,25 @@
 %22);%0A
-                %7D%0A            %7D;%0A        %7D%0A    
+%09%09%09%09%7D%0A%09%09%09%7D;%0A%09%09%7D%0A%09
 %7D%0A%7D%0A

fix checkstyle errors