generated from micronaut-projects/micronaut-project-template
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle accept license as string (#240)
solve issues found in starter ``` ERROR i.m.http.server.RouteExecutor - Unexpected error occurred: class java.lang.String cannot be cast to class java.lang.Boolean (java.lang.String and java.lang.Boolean are in module java.base of loader 'bootstrap') java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Boolean (java.lang.String and java.lang.Boolean are in module java.base of loader 'bootstrap') at io.micronaut.testresources.mssql.MSSQLTestResourceProvider.createMSSQLContainer(MSSQLTestResourceProvider.java:50) ``
- Loading branch information
Showing
2 changed files
with
41 additions
and
2 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
23 changes: 23 additions & 0 deletions
23
...sql/src/test/groovy/io/micronaut/testresources/mssql/MSSQLTestResourceProviderSpec.groovy
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 io.micronaut.testresources.mssql | ||
|
||
import io.micronaut.core.util.StringUtils; | ||
import spock.lang.Specification; | ||
|
||
class MSSQLTestResourceProviderSpec extends Specification { | ||
|
||
void "verify String is parsed into boolean for the value of accept-license"(Object value) { | ||
String licenseKey = "containers.mssql.accept-license" | ||
Map<String, Object> testResourcesConfiguration = [(licenseKey): value] | ||
when: | ||
boolean accept = MSSQLTestResourceProvider.shouldAcceptLicense(licenseKey, testResourcesConfiguration) | ||
|
||
then: | ||
noExceptionThrown() | ||
accept | ||
|
||
where: | ||
value << [StringUtils.TRUE, true, Boolean.TRUE] | ||
} | ||
|
||
|
||
} |