Add documentation to test data Factory methods

This commit is contained in:
Andreas Svanberg 2025-02-25 11:48:17 +01:00
parent e7d6698c11
commit 167a73fb01

@ -1,12 +1,46 @@
package se.su.dsv.scipro.testdata;
import se.su.dsv.scipro.security.auth.roles.Roles;
import se.su.dsv.scipro.system.User;
/**
* A factory to help with repetitive tasks when populating test data.
*/
public interface Factory {
/**
* Creates a user with the given first name and last name "Student".
* The user is given the role {@link Roles#AUTHOR}.
* <p>
* A username is created of the form {@code <first_name>@example.com} that
* can be used to log in.
*/
User createAuthor(String firstName);
/**
* Creates a user with the given first name and last name "Employee".
* <p>
* The user is given the role {@link Roles#SUPERVISOR}, {@link Roles#REVIEWER},
* and {@link Roles#EXAMINER}.
* <p>
* The user gets a default research area, unit, and language. It is also
* marked as {@link User#setActiveAsSupervisor(boolean) an active supervisor}.
* <p>
* A username is created of the form {@code <first_name>@example.com} that
* can be used to log in.
*/
User createSupervisor(String firstName);
/**
* Creates a user with the given first name and last name "Employee".
* <p>
* The user is given the role {@link Roles#SUPERVISOR}, {@link Roles#REVIEWER},
* and {@link Roles#EXAMINER}.
* <p>
* The user gets a default research area, unit, and language. It is also
* marked as {@link User#setActiveAsSupervisor(boolean) an active supervisor}.
* <p>
* A username is created of the form {@code <first_name>@example.com} that
* can be used to log in.
*/
User createReviewer(String firstName);
}