mirror of
				https://github.com/vran-dev/databasir.git
				synced 2025-11-04 16:26:10 +08:00 
			
		
		
		
	fix: ut execute error
This commit is contained in:
		@@ -38,5 +38,6 @@ dependencies {
 | 
				
			|||||||
    // test
 | 
					    // test
 | 
				
			||||||
    testImplementation "mysql:mysql-connector-java:${mysqlConnectorVersion}"
 | 
					    testImplementation "mysql:mysql-connector-java:${mysqlConnectorVersion}"
 | 
				
			||||||
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
 | 
					    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.junit.jupiter.api.extension.ExtendWith;
 | 
				
			||||||
import org.springframework.boot.test.context.SpringBootTest;
 | 
					import org.springframework.boot.test.context.SpringBootTest;
 | 
				
			||||||
import org.springframework.test.context.ActiveProfiles;
 | 
					import org.springframework.test.context.ActiveProfiles;
 | 
				
			||||||
import org.springframework.test.context.jdbc.Sql;
 | 
					 | 
				
			||||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
 | 
					import org.springframework.test.context.junit.jupiter.SpringExtension;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@SpringBootTest(classes = CoreTestApplication.class)
 | 
					@SpringBootTest(classes = CoreTestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.NONE)
 | 
				
			||||||
@ActiveProfiles("ut")
 | 
					@ActiveProfiles("ut")
 | 
				
			||||||
@ExtendWith(SpringExtension.class)
 | 
					@ExtendWith(SpringExtension.class)
 | 
				
			||||||
@Sql({"classpath:sql/init.sql"})
 | 
					 | 
				
			||||||
public class BaseTest {
 | 
					public class BaseTest {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,7 +31,10 @@ class DocumentEventSubscriberTest extends BaseTest {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Test
 | 
					    @Test
 | 
				
			||||||
    @Sql("classpath:/sql/event/subscriber/DocumentEventSubscriberTest.sql")
 | 
					    @Sql(scripts = {
 | 
				
			||||||
 | 
					            "classpath:sql/event/subscriber/DocumentEventSubscriberTest.sql",
 | 
				
			||||||
 | 
					            "classpath:sql/init.sql"
 | 
				
			||||||
 | 
					    })
 | 
				
			||||||
    void onDocumentUpdated() {
 | 
					    void onDocumentUpdated() {
 | 
				
			||||||
        var event = new DocumentUpdated();
 | 
					        var event = new DocumentUpdated();
 | 
				
			||||||
        RootDiff diff = new RootDiff();
 | 
					        RootDiff diff = new RootDiff();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -29,7 +29,10 @@ class UserEventSubscriberTest extends BaseTest {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Test
 | 
					    @Test
 | 
				
			||||||
    @Sql("classpath:sql/event/subscriber/UserEventSubscriberTest.sql")
 | 
					    @Sql({
 | 
				
			||||||
 | 
					            "classpath:sql/event/subscriber/UserEventSubscriberTest.sql",
 | 
				
			||||||
 | 
					            "classpath:sql/init.sql"
 | 
				
			||||||
 | 
					    })
 | 
				
			||||||
    void onPasswordRenewed() {
 | 
					    void onPasswordRenewed() {
 | 
				
			||||||
        var event = UserPasswordRenewed.builder()
 | 
					        var event = UserPasswordRenewed.builder()
 | 
				
			||||||
                .email("ut@databasir.com")
 | 
					                .email("ut@databasir.com")
 | 
				
			||||||
@@ -43,7 +46,10 @@ class UserEventSubscriberTest extends BaseTest {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Test
 | 
					    @Test
 | 
				
			||||||
    @Sql("classpath:sql/event/subscriber/UserEventSubscriberTest.sql")
 | 
					    @Sql({
 | 
				
			||||||
 | 
					            "classpath:sql/event/subscriber/UserEventSubscriberTest.sql",
 | 
				
			||||||
 | 
					            "classpath:sql/init.sql"
 | 
				
			||||||
 | 
					    })
 | 
				
			||||||
    void onUserCreated() {
 | 
					    void onUserCreated() {
 | 
				
			||||||
        var event = UserCreated.builder()
 | 
					        var event = UserCreated.builder()
 | 
				
			||||||
                .username("ut")
 | 
					                .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)
 | 
					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',
 | 
					VALUES (999, 'ut@databasir.com', '123456', 'smtp.exmail.databasir.com', 465, 1, '2022-03-25 03:14:27',
 | 
				
			||||||
        '2022-03-21 14:20:56');
 | 
					        '2022-03-21 14:20:56');
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user