fix: ut execute error
This commit is contained in:
parent
b2a50a844a
commit
83af72e5a7
|
@ -38,5 +38,6 @@ dependencies {
|
|||
// test
|
||||
testImplementation "mysql:mysql-connector-java:${mysqlConnectorVersion}"
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
testImplementation 'org.flywaydb:flyway-core'
|
||||
}
|
||||
|
||||
|
|
|
@ -3,12 +3,10 @@ package com.databasir.core;
|
|||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.jdbc.Sql;
|
||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
|
||||
@SpringBootTest(classes = CoreTestApplication.class)
|
||||
@SpringBootTest(classes = CoreTestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
||||
@ActiveProfiles("ut")
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@Sql({"classpath:sql/init.sql"})
|
||||
public class BaseTest {
|
||||
}
|
||||
|
|
|
@ -31,7 +31,10 @@ class DocumentEventSubscriberTest extends BaseTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Sql("classpath:/sql/event/subscriber/DocumentEventSubscriberTest.sql")
|
||||
@Sql(scripts = {
|
||||
"classpath:sql/event/subscriber/DocumentEventSubscriberTest.sql",
|
||||
"classpath:sql/init.sql"
|
||||
})
|
||||
void onDocumentUpdated() {
|
||||
var event = new DocumentUpdated();
|
||||
RootDiff diff = new RootDiff();
|
||||
|
|
|
@ -29,7 +29,10 @@ class UserEventSubscriberTest extends BaseTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Sql("classpath:sql/event/subscriber/UserEventSubscriberTest.sql")
|
||||
@Sql({
|
||||
"classpath:sql/event/subscriber/UserEventSubscriberTest.sql",
|
||||
"classpath:sql/init.sql"
|
||||
})
|
||||
void onPasswordRenewed() {
|
||||
var event = UserPasswordRenewed.builder()
|
||||
.email("ut@databasir.com")
|
||||
|
@ -43,7 +46,10 @@ class UserEventSubscriberTest extends BaseTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Sql("classpath:sql/event/subscriber/UserEventSubscriberTest.sql")
|
||||
@Sql({
|
||||
"classpath:sql/event/subscriber/UserEventSubscriberTest.sql",
|
||||
"classpath:sql/init.sql"
|
||||
})
|
||||
void onUserCreated() {
|
||||
var event = UserCreated.builder()
|
||||
.username("ut")
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
# mail configuration
|
||||
REPLACE INTO databasir.sys_mail (id, username, password, smtp_host, smtp_port, use_ssl, update_at, create_at)
|
||||
VALUES (999, 'ut@databasir.com', '123456', 'smtp.exmail.databasir.com', 465, 1, '2022-03-25 03:14:27',
|
||||
'2022-03-21 14:20:56');
|
||||
|
|
Loading…
Reference in New Issue