use of com.epam.pipeline.entity.pipeline.ToolGroup in project cloud-pipeline by epam.
the class ToolGroupManagerTest method createToolGroup.
private ToolGroup createToolGroup() {
ToolGroup group = new ToolGroup();
group.setName("test");
group.setRegistryId(registry.getId());
group.setDescription(TEST_DESCRIPTION);
toolGroupManager.create(group);
return group;
}
use of com.epam.pipeline.entity.pipeline.ToolGroup in project cloud-pipeline by epam.
the class ToolGroupManagerTest method testUpdateToolGroup.
@Test
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void testUpdateToolGroup() {
ToolGroup group = createToolGroup();
ToolGroup original = toolGroupManager.load(group.getId());
group.setDescription(TEST_OTHER_DESCRIPTION);
group.setName("foo");
group.setOwner("bar");
group.setRegistryId(0L);
toolGroupManager.updateToolGroup(group);
ToolGroup updated = toolGroupManager.load(group.getId());
Assert.assertEquals(TEST_OTHER_DESCRIPTION, updated.getDescription());
Assert.assertEquals(original.getName(), updated.getName());
Assert.assertEquals(original.getOwner(), updated.getOwner());
Assert.assertEquals(original.getRegistryId(), updated.getRegistryId());
}
use of com.epam.pipeline.entity.pipeline.ToolGroup in project cloud-pipeline by epam.
the class ToolGroupManagerTest method testLoadByNameWIthRegistry.
@Test
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void testLoadByNameWIthRegistry() {
ToolGroup group = createToolGroup();
ToolGroup loadedGroup = toolGroupManager.loadByNameOrId(registry.getPath() + "/" + group.getName());
Assert.assertEquals(group.getId(), loadedGroup.getId());
Assert.assertEquals(group.getName(), loadedGroup.getName());
}
use of com.epam.pipeline.entity.pipeline.ToolGroup in project cloud-pipeline by epam.
the class ToolGroupApiServiceTest method testCreateToolGroup.
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
@WithMockUser(username = TEST_USER2, roles = TOOL_GROUP_MANAGER_ROLE)
@Test()
public void testCreateToolGroup() {
ToolGroup group = createToolGroup();
ToolGroup loaded = toolGroupApiService.load(group.getId());
Assert.assertEquals(group.getName(), loaded.getName());
Assert.assertEquals(group.getRegistryId(), loaded.getRegistryId());
Assert.assertEquals(TEST_USER2, loaded.getOwner());
}
use of com.epam.pipeline.entity.pipeline.ToolGroup in project cloud-pipeline by epam.
the class ToolGroupApiServiceTest method createToolGroup.
private ToolGroup createToolGroup() {
ToolGroup group = new ToolGroup();
group.setName("dev");
group.setRegistryId(registry.getId());
group = toolGroupApiService.create(group);
return group;
}
Aggregations