WIP: Improve test data creation #112
@ -1,10 +1,12 @@
|
||||
package se.su.dsv.scipro.testdata;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import se.su.dsv.scipro.war.PluginConfiguration;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ComponentScan(basePackages = "se.su.dsv.scipro.testdata.populators")
|
||||
public class TestDataConfiguration implements PluginConfiguration {
|
||||
|
||||
@Bean
|
||||
|
8
test-data/src/main/java/se/su/dsv/scipro/testdata/package-info.java
vendored
Normal file
8
test-data/src/main/java/se/su/dsv/scipro/testdata/package-info.java
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* This package contains the infrastructure that is used when generating test data for the application. To add new test
|
||||
* data to the system, add a new class to the {@link se.su.dsv.scipro.testdata.populators} package that implements the
|
||||
* {@link se.su.dsv.scipro.testdata.TestDataPopulator} interface and annotate it with
|
||||
* {@link org.springframework.stereotype.Service @Service}. Inject dependencies as needed using
|
||||
* {@link jakarta.inject.Inject @Inject}.
|
||||
*/
|
||||
package se.su.dsv.scipro.testdata;
|
13
test-data/src/main/java/se/su/dsv/scipro/testdata/populators/package-info.java
vendored
Normal file
13
test-data/src/main/java/se/su/dsv/scipro/testdata/populators/package-info.java
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Contains classes that populate the database with test data.
|
||||
* <p>
|
||||
* Prefer to use methods on the various services to create data, rather than directly interacting with the database
|
||||
* using an {@link jakarta.persistence.EntityManager}. This is to make sure all business rules are enforced and that
|
||||
* any additional logic is executed such as sending notifications or calculating statistics.
|
||||
*
|
||||
* @see se.su.dsv.scipro.testdata how to add new populators
|
||||
* @see se.su.dsv.scipro.testdata.TestDataPopulator
|
||||
* @see se.su.dsv.scipro.testdata.BaseData
|
||||
* @see se.su.dsv.scipro.testdata.Factory
|
||||
*/
|
||||
package se.su.dsv.scipro.testdata.populators;
|
Loading…
x
Reference in New Issue
Block a user