@BeforeClass
public static void beforeClass() throws IOException, CatalogException, URISyntaxException {
Configuration configuration = Configuration.load(CatalogSampleAnnotationsLoaderTest.class.getClassLoader()
.getClass().getResource("/configuration-test.yml").openStream());
configuration.getAdmin().setAlgorithm("HS256");
catalogManager = new CatalogManager(configuration);
catalogManager.deleteCatalogDB(true);
catalogManager.installCatalogDB("dummy", "admin");
loader = new CatalogSampleAnnotationsLoader(catalogManager);
String pedFileName = "20130606_g1k.ped";
URL pedFileURL = CatalogSampleAnnotationsLoader.class.getClassLoader().getResource(pedFileName);
pedigree = loader.readPedigree(pedFileURL.getPath());
userId = "user1";
catalogManager.getUserManager().create(userId, userId, "asdasd@asd.asd", userId, "", -1L, Account.FULL, QueryOptions.empty(), null);
sessionId = catalogManager.getUserManager().login(userId, userId);
Project project = catalogManager.getProjectManager().create("def", "default", "", "ACME", "Homo sapiens",
null, null, "GRCh38", new QueryOptions(), sessionId).getResult().get(0);
Study study = catalogManager.getStudyManager().create(project.getFqn(), "def", null, "default", Study.Type.FAMILY, null, "", null, null, null, null, null, null, null, null, sessionId).getResult().get(0);
studyId = study.getFqn();
pedFile = catalogManager.getFileManager().create(studyId, File.Type.FILE, File.Format.PED, File.Bioformat
.OTHER_PED, "data/" + pedFileName, null, "", null, 0, -1, null, (long) -1, null, null, true, null, null, sessionId)
.getResult().get(0);
new FileUtils(catalogManager).upload(pedFileURL.toURI(), pedFile, null, sessionId, false, false, false, true, 10000000);
pedFile = catalogManager.getFileManager().get(studyId, pedFile.getPath(), null, sessionId).getResult().get(0);
}