This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit cb327bba20498c1afb87eadad9b699b49d5fbd8e Author: Otavio Rodolfo Piske <angusyo...@gmail.com> AuthorDate: Tue May 23 17:37:26 2023 +0200 (chores) camel-util: added an Unit test for the URIScanner --- .../java/org/apache/camel/util/URIScannerTest.java | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/core/camel-util/src/test/java/org/apache/camel/util/URIScannerTest.java b/core/camel-util/src/test/java/org/apache/camel/util/URIScannerTest.java new file mode 100644 index 00000000000..b2c2f869e80 --- /dev/null +++ b/core/camel-util/src/test/java/org/apache/camel/util/URIScannerTest.java @@ -0,0 +1,43 @@ +/* + * 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.util; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +class URIScannerTest { + + @Test + void testNotRawURIScanner() { + final String resolvedRaw = URIScanner.resolveRaw("foo"); + Assertions.assertNull(resolvedRaw); + } + + @Test + void testURIScannerRawType1() { + final String resolvedRaw1 = URIScanner.resolveRaw("RAW(++?w0rd)"); + Assertions.assertEquals("++?w0rd", resolvedRaw1); + } + + + @Test + void testURIScannerType2() { + final String resolvedRaw1 = URIScanner.resolveRaw("RAW{++?w0rd}"); + Assertions.assertEquals("++?w0rd", resolvedRaw1); + } +}