Пример #1
0
  @Before
  public void setUp() {
    cpuProfile1.setId(Guid.newGuid());
    cpuProfile1.setClusterId(CLUSTER_ID);
    cpuProfile1.setName("CpuProfile 1");

    cpuProfile2.setId(Guid.newGuid());
    cpuProfile2.setClusterId(CLUSTER_ID);
    cpuProfile2.setName("CpuProfile 2");

    when(cpuProfileDao.get(cpuProfile1.getId())).thenReturn(cpuProfile1);
    when(cpuProfileDao.get(cpuProfile2.getId())).thenReturn(cpuProfile2);
    when(cpuProfileDao.getAllForCluster(CLUSTER_ID))
        .thenReturn(Arrays.asList(cpuProfile1, cpuProfile2));

    when(permissionDao.getEntityPermissions(
            USER_1_ID,
            ActionGroup.ASSIGN_CPU_PROFILE,
            cpuProfile1.getId(),
            VdcObjectType.CpuProfile))
        .thenReturn(Guid.newGuid());

    when(permissionDao.getEntityPermissions(
            USER_2_ID,
            ActionGroup.ASSIGN_CPU_PROFILE,
            cpuProfile2.getId(),
            VdcObjectType.CpuProfile))
        .thenReturn(Guid.newGuid());
  }