File tree Expand file tree Collapse file tree 2 files changed +20
-54
lines changed
deployment/src/test/java/io/quarkiverse/openapi/generator/deployment/circuitbreaker Expand file tree Collapse file tree 2 files changed +20
-54
lines changed Original file line number Diff line number Diff line change 11package io .quarkiverse .openapi .generator .deployment .circuitbreaker ;
22
3- import static org .assertj .core .api .Assertions .assertThat ;
4-
3+ import java .io .IOException ;
4+ import java .io .UncheckedIOException ;
5+ import java .net .URL ;
56import java .util .List ;
67import java .util .Map ;
8+ import java .util .Objects ;
79
810import org .eclipse .microprofile .config .Config ;
911import org .eclipse .microprofile .config .spi .ConfigProviderResolver ;
1012import org .junit .jupiter .api .Test ;
1113
14+ import io .smallrye .config .PropertiesConfigSource ;
15+
16+ import static org .assertj .core .api .Assertions .assertThat ;
17+
1218class CircuitBreakerConfigurationParserTest {
1319
1420 @ Test
@@ -43,10 +49,21 @@ void missingCircuitBreakerEnabledConfigShouldReturnEmptyConfig() {
4349 }
4450
4551 private static Config mockConfig (String propertiesFile ) {
52+ PropertiesConfigSource configSource ;
53+ try {
54+ configSource = new PropertiesConfigSource (getResource (propertiesFile ));
55+ } catch (IOException e ) {
56+ throw new UncheckedIOException (e );
57+ }
58+
4659 return ConfigProviderResolver
4760 .instance ()
4861 .getBuilder ()
49- .withSources (new FileConfigSource ( propertiesFile ) )
62+ .withSources (configSource )
5063 .build ();
5164 }
65+
66+ private static URL getResource (String resourcePath ) {
67+ return Objects .requireNonNull (CircuitBreakerConfigurationParserTest .class .getResource (resourcePath ));
68+ }
5269}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments