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 46b33293bd840aaf59947147f6530a5b1ff62c36 Author: Otavio Rodolfo Piske <angusyo...@gmail.com> AuthorDate: Tue May 14 17:03:10 2024 +0200 (chores) camel-test-junit5: move the JUnitPropertiesSource to a separate class --- .../apache/camel/test/junit5/CamelTestSupport.java | 12 +------ .../camel/test/junit5/JunitPropertiesSource.java | 39 ++++++++++++++++++++++ 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java b/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java index 60d8103ff03..c35fc26ce9b 100644 --- a/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java +++ b/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java @@ -539,17 +539,7 @@ public abstract class CamelTestSupport if (extra != null && !extra.isEmpty()) { pc.setOverrideProperties(extra); } - pc.addPropertiesSource(new PropertiesSource() { - @Override - public String getName() { - return "junit-store"; - } - - @Override - public String getProperty(String name) { - return globalStore.get(name, String.class); - } - }); + pc.addPropertiesSource(new JunitPropertiesSource(globalStore)); Boolean ignore = ignoreMissingLocationWithPropertiesComponent(); if (ignore != null) { pc.setIgnoreMissingLocation(ignore); diff --git a/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/JunitPropertiesSource.java b/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/JunitPropertiesSource.java new file mode 100644 index 00000000000..e52c4637891 --- /dev/null +++ b/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/JunitPropertiesSource.java @@ -0,0 +1,39 @@ +/* + * 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.test.junit5; + +import org.apache.camel.spi.PropertiesSource; +import org.junit.jupiter.api.extension.ExtensionContext; + +class JunitPropertiesSource implements PropertiesSource { + private final ExtensionContext.Store globalStore; + + JunitPropertiesSource(ExtensionContext.Store globalStore) { + this.globalStore = globalStore; + } + + @Override + public String getName() { + return "junit-store"; + } + + @Override + public String getProperty(String name) { + return globalStore.get(name, String.class); + } +}