use of org.hisp.dhis.actions.metadata.MetadataActions in project dhis2-core by dhis2.
the class MetadataImportTest method before.
@BeforeAll
public void before() {
metadataActions = new MetadataActions();
systemActions = new SystemActions();
new LoginActions().loginAsSuperUser();
}
use of org.hisp.dhis.actions.metadata.MetadataActions in project dhis2-core by dhis2.
the class MetadataSetupExtension method beforeAll.
@Override
public void beforeAll(ExtensionContext context) {
if (!started) {
started = true;
logger.info("Importing metadata for tests");
// The following line registers a callback hook when the root test
// context is shut down
context.getRoot().getStore(GLOBAL).put("MetadataSetupExtension", this);
MetadataActions metadataActions = new MetadataActions();
new LoginActions().loginAsDefaultUser();
String[] files = { "src/test/resources/setup/userGroups.json", "src/test/resources/setup/metadata.json", // importing for the second time to make sure all sharing is set up correctly - there are bugs in metadata importer
"src/test/resources/setup/metadata.json", "src/test/resources/setup/tracker_metadata.json", "src/test/resources/setup/userRoles.json", "src/test/resources/setup/users.json" };
String queryParams = "async=false";
for (String fileName : files) {
metadataActions.importAndValidateMetadata(new File(fileName), queryParams);
}
setupUsers();
createdData.putAll(TestRunStorage.getCreatedEntities());
TestRunStorage.removeAllEntities();
}
}
use of org.hisp.dhis.actions.metadata.MetadataActions in project dhis2-core by dhis2.
the class DataImportTest method before.
@BeforeAll
public void before() {
dataValueSetActions = new DataValueSetActions();
metadataActions = new MetadataActions();
dataValueActions = new DataValueActions();
systemActions = new SystemActions();
new LoginActions().loginAsSuperUser();
metadataActions.importMetadata(new File("src/test/resources/aggregate/metadata.json"), "async=false").validate().statusCode(200);
}
use of org.hisp.dhis.actions.metadata.MetadataActions in project dhis2-core by dhis2.
the class UserAssignmentTests method beforeAll.
@BeforeAll
public void beforeAll() {
metadataActions = new MetadataActions();
programActions = new ProgramActions();
eventActions = new EventActions();
loginActions = new LoginActions();
loginActions.loginAsSuperUser();
metadataActions.importAndValidateMetadata(new File("src/test/resources/tracker/eventProgram.json"));
}
use of org.hisp.dhis.actions.metadata.MetadataActions in project dhis2-core by dhis2.
the class TrackedEntityInstanceAclReadTests method before.
@BeforeAll
public void before() throws Exception {
teiActions = new TEIActions();
metadataActions = new MetadataActions();
userActions = new UserActions();
// Setup as SuperUser
new LoginActions().loginAsDefaultUser();
// Set up metadata (Import twice to connect all references)
metadataActions.importAndValidateMetadata(new File("src/test/resources/tracker/acl/metadata.json"));
metadataActions.importAndValidateMetadata(new File("src/test/resources/tracker/acl/metadata.json"));
// Import test data
teiActions.postFile(new File("src/test/resources/tracker/acl/data.json"));
// Set up all users for testing
users.add(new User("User A", "O2PajOxjJSa", "UserA!123"));
users.add(new User("User B", "aDy67f9ijOe", "UserB!123"));
users.add(new User("User C", "CKrrGm5Be8O", "UserC!123"));
users.add(new User("User D", "Lpa5INiC3Qf", "UserD!123"));
users.add(new User("User ALL", "GTqb3WOZMop", "UserALL!123"));
// Update passwords, so we can log in as them
// Set AllAuth if user has it and ou scopes.
// Map metadata and data sharing
users.forEach(this::setupUser);
}
Aggregations