use of cz.metacentrum.perun.core.api.BanOnVo in project perun by CESNET.
the class VosManagerEntryIntegrationTest method getBansForVo.
@Test
public void getBansForVo() throws Exception {
System.out.println(CLASS_NAME + "getBansForVo");
Vo createdVo = vosManagerEntry.createVo(sess, myVo);
Member member = createMemberFromExtSource(createdVo);
BanOnVo ban = new BanOnVo();
ban.setMemberId(member.getId());
vosManagerEntry.setBan(sess, ban);
List<BanOnVo> voBans = vosManagerEntry.getBansForVo(sess, createdVo.getId());
assertThat(voBans).containsOnly(ban);
}
use of cz.metacentrum.perun.core.api.BanOnVo in project perun by CESNET.
the class VosManagerEntryIntegrationTest method getBanByIdCorrectly.
@Test
public void getBanByIdCorrectly() throws Exception {
System.out.println(CLASS_NAME + "getBanByIdCorrectly");
Vo createdVo = vosManagerEntry.createVo(sess, myVo);
Member member = createMemberFromExtSource(createdVo);
BanOnVo ban = new BanOnVo();
ban.setMemberId(member.getId());
ban = vosManagerEntry.setBan(sess, ban);
BanOnVo foundBan = vosManagerEntry.getBanById(sess, ban.getId());
assertThat(foundBan).isEqualToIgnoringNullFields(ban);
}
use of cz.metacentrum.perun.core.api.BanOnVo in project perun by CESNET.
the class VosManagerImplIntegrationTest method getBansForVo.
@Test
public void getBansForVo() {
System.out.println(CLASS_NAME + "getBansForVo");
BanOnVo originBan = new BanOnVo(-1, member.getId(), vo.getId(), new Date(), "noob");
originBan = vosManagerImpl.setBan(sess, originBan);
BanOnVo otherBan = new BanOnVo(-1, otherMember.getId(), otherVo.getId(), new Date(), "noob");
vosManagerImpl.setBan(sess, otherBan);
List<BanOnVo> voBans = vosManagerImpl.getBansForVo(sess, vo.getId());
assertThat(voBans).containsOnly(originBan);
}
use of cz.metacentrum.perun.core.api.BanOnVo in project perun by CESNET.
the class VosManagerImplIntegrationTest method getBanById.
@Test
public void getBanById() throws Exception {
System.out.println(CLASS_NAME + "getBanById");
BanOnVo originBan = new BanOnVo(-1, member.getId(), vo.getId(), new Date(), "noob");
originBan = vosManagerImpl.setBan(sess, originBan);
BanOnVo actualBan = vosManagerImpl.getBanById(sess, originBan.getId());
isValidBan(actualBan, originBan.getId(), originBan.getMemberId(), originBan.getVoId(), originBan.getValidityTo(), originBan.getDescription());
}
use of cz.metacentrum.perun.core.api.BanOnVo in project perun by CESNET.
the class VosManagerEntryIntegrationTest method setBanCorrectly.
@Test
public void setBanCorrectly() throws Exception {
System.out.println(CLASS_NAME + "setBanCorrectly");
Vo createdVo = vosManagerEntry.createVo(sess, myVo);
Member member = createMemberFromExtSource(createdVo);
BanOnVo ban = new BanOnVo();
ban.setMemberId(member.getId());
ban = vosManagerEntry.setBan(sess, ban);
assertThat(ban.getId()).isNotNull();
assertThat(ban.getVoId()).isNotNull();
BanOnVo foundBan = vosManagerEntry.getBanById(sess, ban.getId());
assertThat(foundBan).isEqualToIgnoringNullFields(ban);
}
Aggregations