This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PLAT-3546: The validating config factory was always overridden by the…
… default config factory because of the bootstrap binding. Validation of the configs did not work. That is fixed by changing the order of the modules binding in relation to the bootstrap binding.
- Loading branch information
Showing
3 changed files
with
35 additions
and
36 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
23 changes: 23 additions & 0 deletions
23
validation/src/test/java/se/fortnox/reactivewizard/validation/ValidationModuleTest.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,23 @@ | ||
package se.fortnox.reactivewizard.validation; | ||
|
||
import org.assertj.core.api.Assertions; | ||
import org.junit.Test; | ||
import se.fortnox.reactivewizard.binding.scanners.ConfigClassScanner; | ||
import se.fortnox.reactivewizard.binding.scanners.InjectAnnotatedScanner; | ||
import se.fortnox.reactivewizard.config.ConfigAutoBindModule; | ||
|
||
import static org.mockito.Mockito.mock; | ||
|
||
public class ValidationModuleTest { | ||
|
||
@Test | ||
public void validationModuleShouldGoAfterConfigModule() { | ||
InjectAnnotatedScanner injectAnnotatedScanner = mock(InjectAnnotatedScanner.class); | ||
ValidationModule validationModule = new ValidationModule(injectAnnotatedScanner); | ||
|
||
ConfigClassScanner configClassScanner = mock(ConfigClassScanner.class); | ||
ConfigAutoBindModule configAutoBindModule = new ConfigAutoBindModule(configClassScanner); | ||
|
||
Assertions.assertThat(configAutoBindModule.getPrio()).isLessThan(validationModule.getPrio()); | ||
} | ||
} |