should have one zero-argument constructor

This commit is contained in:
thinkgem
2025-11-02 23:57:05 +08:00
parent fde55e9cdf
commit ed6ef1fd38
6 changed files with 31 additions and 19 deletions

View File

@@ -9,6 +9,7 @@ import com.jeesite.common.tests.BaseSpringContextTests;
import com.jeesite.modules.test.dao.TestDataDao;
import com.jeesite.modules.test.entity.TestData;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
@@ -23,9 +24,10 @@ import java.util.List;
@SpringBootTest(classes = ApplicationTest.class)
public class InsertBatchTest extends BaseSpringContextTests {
private final TestDataDao testDataDao;
private TestDataDao testDataDao;
public InsertBatchTest(TestDataDao testDataDao) {
@Autowired
public void setInsertBatchTest(TestDataDao testDataDao) {
this.testDataDao = testDataDao;
}

View File

@@ -11,6 +11,7 @@ import com.jeesite.modules.test.entity.TestData;
import com.jeesite.modules.test.entity.TestDataChild;
import com.jeesite.modules.test.service.TestDataService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
@@ -31,9 +32,10 @@ import java.util.concurrent.Executors;
@SpringBootTest(classes = ApplicationTest.class)
public class MultiDataSourceTest extends BaseSpringContextTests {
private final TestDataService testDataService;
private TestDataService testDataService;
public MultiDataSourceTest(TestDataService testDataService) {
@Autowired
public void setMultiDataSourceTest(TestDataService testDataService) {
this.testDataService = testDataService;
}