-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes in type convertors (because of CAMEL-19897)x
- Loading branch information
1 parent
4fafc1a
commit 0a09d98
Showing
12 changed files
with
141 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...r/src/test/java/org/apache/camel/quarkus/core/converter/it/ConverterWithStatisticsIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* 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.quarkus.core.converter.it; | ||
|
||
import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
|
||
@QuarkusIntegrationTest | ||
public class ConverterWithStatisticsIT extends ConverterWithStatisticsTest { | ||
} |
77 changes: 77 additions & 0 deletions
77
...src/test/java/org/apache/camel/quarkus/core/converter/it/ConverterWithStatisticsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* 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.quarkus.core.converter.it; | ||
|
||
import io.quarkus.test.junit.QuarkusTest; | ||
import io.restassured.RestAssured; | ||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.hamcrest.Matchers.is; | ||
|
||
/** | ||
* The test requires the `quarkus.camel.type-converter.statistics-enabled=true`. | ||
* | ||
* For JVM mode, such behavior is achieved by the testProfile. | ||
* For native mode, the quarkus-maven-plugin is executed twice with both false/true options in the property. | ||
* Test profile changes the value to `true` for this class. | ||
* Quarkus the uses `-Dquarkus.configuration.build-time-mismatch-at-runtime=fail | ||
* -Dquarkus.camel.type-converter.statistics-enabled=true`. | ||
* See https://quarkus.io/guides/reaugmentation for more details. | ||
*/ | ||
@QuarkusTest | ||
public class ConverterWithStatisticsTest extends ConverterTestBase { | ||
|
||
@BeforeEach | ||
void beforeEach() { | ||
resetStatistics(); | ||
} | ||
|
||
@AfterEach | ||
void afterEach() { | ||
resetStatistics(); | ||
} | ||
|
||
@Test | ||
void testConverterToNull() { | ||
testConverterReturningNull("/converter/myNullablePair", "null"); | ||
|
||
RestAssured.when().get("/converter/getStatisticsHit").then().body("hit", is(1), "miss", is(0)); | ||
|
||
resetStatistics(); | ||
} | ||
|
||
@Test | ||
void testNotRegisteredConverter() { | ||
testConverterReturningNull("/converter/myNotRegisteredPair", "a:b"); | ||
|
||
RestAssured.when().get("/converter/getStatisticsHit").then().body("hit", is(0), "miss", is(1)); | ||
|
||
resetStatistics(); | ||
} | ||
|
||
@Test | ||
void testConverterGetStatistics() { | ||
//cause 1 hit | ||
testConverter("/converter/myTestPair/string", "a:b", "test_a", "b"); | ||
|
||
RestAssured.when().get("/converter/getStatisticsHit").then().body("hit", is(1), "miss", is(0)); | ||
|
||
resetStatistics(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters