File tree Expand file tree Collapse file tree 3 files changed +19
-18
lines changed
spring-data-jdbc/src/test/java/org/springframework/data/jdbc/testing Expand file tree Collapse file tree 3 files changed +19
-18
lines changed Original file line number Diff line number Diff line change @@ -159,19 +159,20 @@ Runs integration test against a single in memory database.
159
159
160
160
To run integration tests against all supported databases specify the Maven Profile `all-dbs`.
161
161
162
- ```
162
+ [source,bash]
163
+ ----
163
164
./mvnw clean install -Pall-dbs
164
- ```
165
+ ----
165
166
166
- This requires an appropriate `container-license-acceptance.txt` to be on the classpath, signaling that you accept the licence of the databases used.
167
+ This requires an appropriate `container-license-acceptance.txt` to be on the classpath, signaling that you accept the license of the databases used.
167
168
168
- If you don't want to accept these licences you may add the Maven Profile `ignore-missing-licence `.
169
+ If you don't want to accept these licences you may add the Maven Profile `ignore-missing-license `.
169
170
This will ignore the tests that require an explicit license acceptance.
170
171
171
- ```
172
- ./mvnw clean install -Pall-dbs,ignore-missing-licence
173
- ```
174
-
172
+ [source,bash]
173
+ ----
174
+ ./mvnw clean install -Pall-dbs,ignore-missing-license
175
+ ----
175
176
176
177
If you want to run an integration tests against a different database you can do so by activating an apropriate Spring Profile.
177
178
Available are the following Spring Profiles:
Original file line number Diff line number Diff line change 128
128
<includes >
129
129
<include >**/*IntegrationTests.java</include >
130
130
</includes >
131
+ <excludes >
131
132
<exclude >**/*HsqlIntegrationTests.java</exclude >
132
133
</excludes >
133
134
<systemPropertyVariables >
231
232
</build >
232
233
</profile >
233
234
<profile >
234
- <id >ignore-missing-licence </id >
235
+ <id >ignore-missing-license </id >
235
236
<build >
236
237
<plugins >
237
238
<plugin >
238
239
<groupId >org.apache.maven.plugins</groupId >
239
240
<artifactId >maven-surefire-plugin</artifactId >
240
241
<configuration >
241
242
<systemPropertyVariables >
242
- <on-missing-licence >ignore-test</on-missing-licence >
243
+ <on-missing-license >ignore-test</on-missing-license >
243
244
</systemPropertyVariables >
244
245
</configuration >
245
246
</plugin >
Original file line number Diff line number Diff line change 28
28
/**
29
29
* {@link TestExecutionListener} to selectively skip tests if the license for a particular database container was not
30
30
* accepted.
31
- *
31
+ *
32
32
* @author Mark Paluch
33
33
* @author Jens Schauder
34
34
*/
@@ -57,14 +57,13 @@ private void assumeLicenseAccepted(String imageName) {
57
57
LicenseAcceptance .assertLicenseAccepted (imageName );
58
58
} catch (IllegalStateException e ) {
59
59
60
- if (environment .getProperty ("on-missing-licence" , "fail" ).equals ("ignore-test" )) {
61
- throw new AssumptionViolatedException (e .getMessage ());
62
- } else {
63
-
64
- throw new IllegalStateException (
65
- "You need to accept the licence for the database with which you are testing or set \" ignore-missing-licence\" as active profile in order to skip tests for which a licence is missing." ,
66
- e );
60
+ if (environment .getProperty ("on-missing-license" , "fail" ).equals ("ignore-test" )) {
61
+ throw new AssumptionViolatedException (e .getMessage (), e );
67
62
}
63
+
64
+ throw new IllegalStateException (
65
+ "You need to accept the license for the database with which you are testing or set \" ignore-missing-license\" as active profile in order to skip tests for which a license is missing." ,
66
+ e );
68
67
}
69
68
}
70
69
You can’t perform that action at this time.
0 commit comments