1
mirror of https://github.com/CarmJos/EasyConfiguration.git synced 2026-06-05 02:58:20 +08:00

style: Reformatted code with .editorconfig

This commit is contained in:
2025-05-14 04:22:48 +08:00
parent 76d276436b
commit a4abfb733a
86 changed files with 1140 additions and 450 deletions
@@ -10,9 +10,9 @@ import java.io.File;
public class JSONConfigTests {
protected final ConfigurationHolder<?> holder = JSONConfigFactory
.from(new File("target"), "config.json")
.resourcePath("example.json")
.build();
.from(new File("target"), "config.json")
.resourcePath("example.json")
.build();
@Test
public void onTest() {
@@ -17,7 +17,7 @@ public class YamlTests {
public void test() {
ConfigurationHolder<YAMLSource> holder = YAMLConfigFactory.from("target/tests.yml")
.resourcePath("configs/sample.yml").build();
.resourcePath("configs/sample.yml").build();
Validators.activate(holder);
@@ -28,22 +28,22 @@ public class MongoTest {
gsonHolder.initialize(MongoConfig.class);
MongoClientSettings settings = MongoClientSettings.builder()
.applyConnectionString(new ConnectionString(
"mongodb://" + MongoConfig.HOST.resolve() + ":" + MongoConfig.PORT.resolve()
))
.credential(MongoCredential.createCredential(
MongoConfig.USERNAME.resolve(), MongoConfig.DATABASE.resolve(),
MongoConfig.PASSWORD.resolve().toCharArray()
))
.uuidRepresentation(UuidRepresentation.STANDARD)
.build();
.applyConnectionString(new ConnectionString(
"mongodb://" + MongoConfig.HOST.resolve() + ":" + MongoConfig.PORT.resolve()
))
.credential(MongoCredential.createCredential(
MongoConfig.USERNAME.resolve(), MongoConfig.DATABASE.resolve(),
MongoConfig.PASSWORD.resolve().toCharArray()
))
.uuidRepresentation(UuidRepresentation.STANDARD)
.build();
MongoClient mongoClient = MongoClients.create(settings);
MongoDatabase mongoDatabase = mongoClient.getDatabase(MongoConfig.DATABASE.resolve());
ConfigurationHolder<?> mongoHolder = MongoConfigFactory
.from(mongoDatabase, "configs")
.namespace("my_plugin")
.build();
.from(mongoDatabase, "configs")
.namespace("my_plugin")
.build();
// Test the configuration
ConfigurationTest.testDemo(mongoHolder);
@@ -33,9 +33,9 @@ public class SQLConfigTest {
manager.setDebugMode(true);
ConfigurationHolder<?> holder = SQLConfigFactory.from(manager)
.tableName("test_configs")
.namespace("testing")
.build();
.tableName("test_configs")
.namespace("testing")
.build();
ConfigurationTest.testDemo(holder);
ConfigurationTest.testInner(holder);