-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run all integration tests using a MySQL test container instead of HSQL
Replace HSQL with MySQL for higher fidelity integration tests and to be able to also test native queries and platform-specific functionality.
- Loading branch information
Showing
7 changed files
with
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
info.build.version=@project.version@ | ||
|
||
spring.flyway.enabled=true | ||
spring.datasource.url=jdbc:tc:mysql:5.7://localhost:3306/mojito?characterEncoding=UTF-8&useUnicode=true&TC_INITSCRIPT=db/mysql/test_init.sql | ||
|
||
l10n.console-writer.ansi-code-enabled=false | ||
l10n.console-writer.output-type=ANSI_LOGGER |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER DATABASE `mojito` CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_bin'; |
25 changes: 25 additions & 0 deletions
25
webapp/src/test/java/com/box/l10n/mojito/db/MySQLIntegrationTest.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,25 @@ | ||
package com.box.l10n.mojito.db; | ||
|
||
import com.box.l10n.mojito.aws.s3.AmazonS3Configuration; | ||
import com.box.l10n.mojito.aws.s3.AmazonS3ConfigurationProperties; | ||
import com.box.l10n.mojito.service.DBUtils; | ||
import com.box.l10n.mojito.service.blobstorage.s3.S3BlobStorageConfigurationProperties; | ||
import com.box.l10n.mojito.service.blobstorage.s3.S3BlobStorageTest; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||
|
||
@RunWith(SpringJUnit4ClassRunner.class) | ||
@SpringBootTest(classes = {DBUtils.class}) | ||
public class MySQLIntegrationTest { | ||
@Autowired | ||
DBUtils dbUtils; | ||
|
||
@Test | ||
public void testIntegrationTestsRunOnMysql() { | ||
Assert.assertTrue(dbUtils.isMysql()); | ||
} | ||
} |
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