use of com.walmartlabs.concord.server.org.project.RepositoryDao in project concord by walmartlabs.
the class SecretDaoTest method testOnCascade.
@Test
public void testOnCascade() {
UUID orgId = OrganizationManager.DEFAULT_ORG_ID;
String projectName = "project#" + System.currentTimeMillis();
ProjectDao projectDao = new ProjectDao(getConfiguration(), new ConcordObjectMapper(TestObjectMapper.INSTANCE));
UUID projectId = projectDao.insert(orgId, projectName, "test", null, null, null, null, new byte[0], null, null);
String secretName = "secret#" + System.currentTimeMillis();
SecretDao secretDao = new SecretDao(getConfiguration());
UUID secretId = secretDao.insert(orgId, null, secretName, null, SecretType.KEY_PAIR, SecretEncryptedByType.SERVER_KEY, "concord", SecretVisibility.PUBLIC, INSERT);
secretDao.updateData(secretId, new byte[] { 0, 1, 2 });
secretDao.update(secretId, secretName, UUID.fromString("4b9d496a-c3a0-4e1b-804c-ac3fccddcb27"), null, new byte[0], null, projectId, orgId);
String repoName = "repo#" + System.currentTimeMillis();
RepositoryDao repositoryDao = new RepositoryDao(getConfiguration(), new ConcordObjectMapper(TestObjectMapper.INSTANCE));
UUID repoId = repositoryDao.insert(projectId, repoName, "n/a", null, null, null, secretId, false, null, false);
// ---
secretDao.delete(secretId);
// ---
RepositoryEntry r = repositoryDao.get(projectId, repoId);
assertNotNull(r);
assertNull(r.getSecretName());
}
use of com.walmartlabs.concord.server.org.project.RepositoryDao in project concord by walmartlabs.
the class ProjectDaoTest method setUp.
@BeforeEach
public void setUp() {
repositoryDao = new RepositoryDao(getConfiguration(), new ConcordObjectMapper(TestObjectMapper.INSTANCE));
projectDao = new ProjectDao(getConfiguration(), new ConcordObjectMapper(TestObjectMapper.INSTANCE));
}
Aggregations