Search in sources :

Example 36 with ToolGroup

use of com.epam.pipeline.entity.pipeline.ToolGroup in project cloud-pipeline by epam.

the class DockerRegistryDaoTest method deleteDockerRegistryAfterDeletingToolShouldNotThrowsException.

@Test
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void deleteDockerRegistryAfterDeletingToolShouldNotThrowsException() throws Exception {
    DockerRegistry created = getDockerRegistry();
    registryDao.createDockerRegistry(created);
    ToolGroup library = createToolGroup(created);
    toolGroupDao.createToolGroup(library);
    Tool tool = createTool(TOOL_IMAGE, created.getId(), library);
    toolDao.createTool(tool);
    toolDao.deleteTool(tool.getId());
    toolGroupDao.deleteToolGroup(library.getId());
    registryDao.deleteDockerRegistry(created.getId());
}
Also used : DockerRegistry(com.epam.pipeline.entity.pipeline.DockerRegistry) ToolGroup(com.epam.pipeline.entity.pipeline.ToolGroup) Tool(com.epam.pipeline.entity.pipeline.Tool) Test(org.junit.Test) AbstractSpringTest(com.epam.pipeline.AbstractSpringTest) Transactional(org.springframework.transaction.annotation.Transactional)

Example 37 with ToolGroup

use of com.epam.pipeline.entity.pipeline.ToolGroup in project cloud-pipeline by epam.

the class ToolGroupDaoTest method loadToolGroup1.

@Test
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void loadToolGroup1() {
    ToolGroup group = saveToolGroup(TEST_GROUP_NAME, registry);
    Optional<ToolGroup> loaded = toolGroupDao.loadToolGroup(group.getName(), group.getRegistryId());
    checkFields(group, loaded);
}
Also used : ToolGroup(com.epam.pipeline.entity.pipeline.ToolGroup) Test(org.junit.Test) AbstractSpringTest(com.epam.pipeline.AbstractSpringTest) Transactional(org.springframework.transaction.annotation.Transactional)

Example 38 with ToolGroup

use of com.epam.pipeline.entity.pipeline.ToolGroup in project cloud-pipeline by epam.

the class ToolGroupDaoTest method testUpdateToolGroup.

@Test
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void testUpdateToolGroup() {
    ToolGroup group = saveToolGroup(TEST_GROUP_NAME, registry);
    group.setDescription(TEST_OTHER_DESCRIPTION);
    group.setOwner(TEST_USER2);
    toolGroupDao.updateToolGroup(group);
    ToolGroup loaded = toolGroupDao.loadToolGroup(group.getId()).get();
    Assert.assertEquals(TEST_USER2, loaded.getOwner());
    Assert.assertEquals(TEST_OTHER_DESCRIPTION, loaded.getDescription());
}
Also used : ToolGroup(com.epam.pipeline.entity.pipeline.ToolGroup) Test(org.junit.Test) AbstractSpringTest(com.epam.pipeline.AbstractSpringTest) Transactional(org.springframework.transaction.annotation.Transactional)

Example 39 with ToolGroup

use of com.epam.pipeline.entity.pipeline.ToolGroup in project cloud-pipeline by epam.

the class ToolGroupDaoTest method getToolGroup.

static ToolGroup getToolGroup(String name, DockerRegistry dockerRegistry) {
    ToolGroup group = new ToolGroup();
    group.setName(name);
    group.setRegistryId(dockerRegistry.getId());
    group.setOwner(TEST_USER);
    group.setDescription(TEST_DESCRIPTION);
    return group;
}
Also used : ToolGroup(com.epam.pipeline.entity.pipeline.ToolGroup)

Example 40 with ToolGroup

use of com.epam.pipeline.entity.pipeline.ToolGroup in project cloud-pipeline by epam.

the class ToolGroupDaoTest method loadToolGroup.

@Test
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void loadToolGroup() {
    ToolGroup group = saveToolGroup(TEST_GROUP_NAME, registry);
    Optional<ToolGroup> loaded = toolGroupDao.loadToolGroup(group.getId());
    checkFields(group, loaded);
}
Also used : ToolGroup(com.epam.pipeline.entity.pipeline.ToolGroup) Test(org.junit.Test) AbstractSpringTest(com.epam.pipeline.AbstractSpringTest) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

ToolGroup (com.epam.pipeline.entity.pipeline.ToolGroup)53 Transactional (org.springframework.transaction.annotation.Transactional)27 DockerRegistry (com.epam.pipeline.entity.pipeline.DockerRegistry)25 Test (org.junit.Test)20 Tool (com.epam.pipeline.entity.pipeline.Tool)14 AbstractSpringTest (com.epam.pipeline.AbstractSpringTest)10 AbstractManagerTest (com.epam.pipeline.manager.AbstractManagerTest)10 Before (org.junit.Before)10 AclPermission (com.epam.pipeline.security.acl.AclPermission)6 List (java.util.List)6 Autowired (org.springframework.beans.factory.annotation.Autowired)6 Propagation (org.springframework.transaction.annotation.Propagation)6 DockerRegistryDao (com.epam.pipeline.dao.docker.DockerRegistryDao)4 AclTestDao (com.epam.pipeline.dao.util.AclTestDao)4 AclClass (com.epam.pipeline.entity.security.acl.AclClass)4 Optional (java.util.Optional)4 Assert (org.junit.Assert)4 WithMockUser (org.springframework.security.test.context.support.WithMockUser)4 PermissionGrantVO (com.epam.pipeline.controller.vo.PermissionGrantVO)3 ToolGroupDao (com.epam.pipeline.dao.tool.ToolGroupDao)3