Skip to content

Commit

Permalink
HSEARCH-3967 Correctly resolve property keys when using overrides/fal…
Browse files Browse the repository at this point in the history
…lbacks in configuration property sources
  • Loading branch information
yrodiere committed Jul 22, 2020
1 parent 109bddd commit 2de37e5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ public Optional<?> get(String key) {

@Override
public Optional<String> resolve(String key) {
return main.resolve( key );
if ( !main.get( key ).isPresent() && fallback.get( key ).isPresent() ) {
return fallback.resolve( key );
}
else {
return main.resolve( key );
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ public Optional<?> get(String key) {

@Override
public Optional<String> resolve(String key) {
return main.resolve( key );
if ( override.get( key ).isPresent() ) {
return override.resolve( key );
}
else {
return main.resolve( key );
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ public void noCall() {
)
.isInstanceOf( SearchException.class )
.hasMessageContainingAll(
"Unable to convert configuration property 'hibernate.search.backend.indexes." + index.name()
+ ".lifecycle.strategy' with value 'update'",
"Unable to convert configuration property 'hibernate.search.backend.lifecycle.strategy' with value 'update'",
"The lifecycle strategy cannot be set at the index level anymore",
"Set the schema management strategy via the property 'hibernate.search.schema_management.strategy' instead"
);
Expand Down

0 comments on commit 2de37e5

Please sign in to comment.