Add database configuration via command-line arguments

A new configuration setup now allows specifying a path for database properties via command-line arguments during application startup. This update also changes the call signature for `DatabaseConnection.initialize()` method to accept a path argument. Similarly, methods in `PropertiesLoader`, `PropertiesWriter`, and `MailSettings` classes were also updated to use the specified path when working with properties files. The `TestForm` class's tests were updated accordingly to handle these changes.
This commit is contained in:
2024-04-28 21:25:09 +02:00
parent 2f1d24598b
commit 49af4a3067
8 changed files with 150 additions and 66 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ public class TestForm {
@BeforeAll
public static void testInsert() {
Assertions.assertDoesNotThrow(DatabaseConnection::initialize);
Assertions.assertDoesNotThrow(() -> DatabaseConnection.initialize());
StoreFormQuery storeFormQuery = new StoreFormQuery();
ContactFormData contactFormData = new ContactFormData("akastijn", "[email protected]", "This is a test question.");
storeFormQuery.storeFormForVerificationCode("[email protected]", contactFormData).
@@ -28,7 +28,7 @@ public class TestForm {
@Test
public void testRetrieveForm() {
Assertions.assertDoesNotThrow(DatabaseConnection::initialize);
Assertions.assertDoesNotThrow(() -> DatabaseConnection.initialize());
new FormQuery().getFormForCode(String.valueOf(code), "[email protected]").thenAccept(result -> {
Assertions.assertTrue(result.failReason().isEmpty());
Optional<Form> optionalForm = result.form();