-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug Fix Testcontainer MySQL🫸🌀✏️📗 🐧🐳⬆
- Loading branch information
1 parent
441c930
commit 9892914
Showing
4 changed files
with
53 additions
and
12 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
35 changes: 35 additions & 0 deletions
35
src/test/java/com/hendisantika/adminlte/DatasourceHealthTests.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,35 @@ | ||
package com.hendisantika.adminlte; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.testcontainers.containers.MySQLContainer; | ||
import org.testcontainers.junit.jupiter.Container; | ||
import org.testcontainers.junit.jupiter.Testcontainers; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
/** | ||
* Created by IntelliJ IDEA. | ||
* Project : spring-boot-adminlte | ||
* User: hendisantika | ||
* Email: hendisantika@gmail.com | ||
* Telegram : @hendisantika34 | ||
* Date: 6/25/24 | ||
* Time: 23:59 | ||
* To change this template use File | Settings | File Templates. | ||
*/ | ||
@Testcontainers | ||
public class DatasourceHealthTests { | ||
|
||
// will be started before and stopped after each test method | ||
@Container | ||
private final MySQLContainer mySQLContainer = new MySQLContainer("mysql:8.4.0") | ||
.withDatabaseName("users") | ||
.withUsername("yuji") | ||
.withPassword("S3cret"); | ||
|
||
@Test | ||
void test() { | ||
assertThat(mySQLContainer.isRunning()).isTrue(); | ||
assertThat(mySQLContainer.isRunning()).isTrue(); | ||
} | ||
} |
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