-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt properties to required pattern (#5249)
* Add tests that checks properties pattern matching * Update config properties to match the required pattern * Fixed artifact-version deletion config property name --------- Co-authored-by: Eric Wittmann <[email protected]>
- Loading branch information
1 parent
1f56715
commit f4919d5
Showing
16 changed files
with
139 additions
and
107 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
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
32 changes: 32 additions & 0 deletions
32
app/src/test/java/io/apicurio/registry/noprofile/config/ConfigTest.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,32 @@ | ||
package io.apicurio.registry.noprofile.config; | ||
|
||
import io.apicurio.registry.AbstractResourceTestBase; | ||
import io.quarkus.test.junit.QuarkusTest; | ||
import org.eclipse.microprofile.config.ConfigProvider; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.List; | ||
import java.util.stream.StreamSupport; | ||
|
||
@QuarkusTest | ||
public class ConfigTest extends AbstractResourceTestBase { | ||
|
||
@Test | ||
public void configurationTest() { | ||
Iterable<String> propertyNamesIterable = ConfigProvider.getConfig().getPropertyNames(); | ||
|
||
List<String> offendingProperties = StreamSupport.stream(propertyNamesIterable.spliterator(), false) | ||
.filter(propertyName -> propertyName.startsWith("apicurio") | ||
|| propertyName.startsWith("registry")) | ||
.filter(this::propertyDontMatchPattern).peek(System.out::println).toList(); | ||
|
||
Assertions.assertEquals(0, offendingProperties.size()); | ||
} | ||
|
||
private boolean propertyDontMatchPattern(String propertyName) { | ||
boolean hasUpperCase = propertyName.chars().anyMatch(Character::isUpperCase); | ||
boolean hasUnderscore = propertyName.chars().anyMatch(c -> c == '_'); | ||
return hasUpperCase || hasUnderscore; | ||
} | ||
} |
Oops, something went wrong.