You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/01/22 18:51:53 UTC

[07/11] camel git commit: CAMEL-10546: Added a test for GlobalOptionsDefinition in camel-core

CAMEL-10546: Added a test for GlobalOptionsDefinition in camel-core


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d9552e39
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d9552e39
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d9552e39

Branch: refs/heads/master
Commit: d9552e390c08f95001c25f37478ae142fa82e663
Parents: 8430133
Author: aldettinger <al...@gmail.com>
Authored: Thu Jan 19 16:17:11 2017 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Jan 22 18:06:43 2017 +0100

----------------------------------------------------------------------
 .../model/GlobalOptionsDefinitionTest.java      | 53 ++++++++++++++++++++
 1 file changed, 53 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d9552e39/camel-core/src/test/java/org/apache/camel/model/GlobalOptionsDefinitionTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/model/GlobalOptionsDefinitionTest.java b/camel-core/src/test/java/org/apache/camel/model/GlobalOptionsDefinitionTest.java
new file mode 100644
index 0000000..0e8f78a
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/model/GlobalOptionsDefinitionTest.java
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.camel.Exchange;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class GlobalOptionsDefinitionTest {
+
+    private static final String LOG_DEBUG_BODY_MAX_CHARS_VALUE = "500";
+
+    private GlobalOptionsDefinition instance;
+
+    @Before
+    public void setup() {
+        GlobalOptionDefinition globalOption = new GlobalOptionDefinition();
+        globalOption.setKey(Exchange.LOG_DEBUG_BODY_MAX_CHARS);
+        globalOption.setValue(LOG_DEBUG_BODY_MAX_CHARS_VALUE);
+        List<GlobalOptionDefinition> globalOptions = new ArrayList<>();
+        globalOptions.add(globalOption);
+        instance = new GlobalOptionsDefinition();
+        instance.setGlobalOptions(globalOptions);
+    }
+
+    @Test
+    public void asMapShouldCarryOnLogDebugMaxChars() {
+        Map<String, String> map = instance.asMap();
+        Assert.assertNotNull(map);
+        Assert.assertEquals(1, map.size());
+        Assert.assertEquals(LOG_DEBUG_BODY_MAX_CHARS_VALUE, map.get(Exchange.LOG_DEBUG_BODY_MAX_CHARS));
+    }
+
+}