use of cz.metacentrum.perun.core.api.BanOnVo in project perun by CESNET.
the class VosManagerImplIntegrationTest method getBanForMember.
@Test
public void getBanForMember() throws Exception {
System.out.println(CLASS_NAME + "getBanForMember");
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 MembersManagerBlImpl method suspendMemberTo.
@Override
public void suspendMemberTo(PerunSession sess, Member member, Date suspendedTo) {
BanOnVo ban = new BanOnVo();
ban.setMemberId(member.getId());
ban.setVoId(member.getVoId());
ban.setValidityTo(suspendedTo);
try {
perunBl.getVosManagerBl().setBan(sess, ban);
} catch (MemberNotExistsException e) {
// shouldn't happen, we expect that the given member exists
throw new InternalErrorException(e);
}
}
use of cz.metacentrum.perun.core.api.BanOnVo in project perun by CESNET.
the class VosManagerEntryIntegrationTest method getBanForMemberReturnsNullIfNoBanExists.
@Test
public void getBanForMemberReturnsNullIfNoBanExists() throws Exception {
System.out.println(CLASS_NAME + "getBanForMemberReturnsNullIfNoBanExists");
Vo createdVo = vosManagerEntry.createVo(sess, myVo);
Member member = createMemberFromExtSource(createdVo);
BanOnVo foundBan = vosManagerEntry.getBanForMember(sess, member);
assertThat(foundBan).isNull();
}
use of cz.metacentrum.perun.core.api.BanOnVo in project perun by CESNET.
the class VosManagerEntryIntegrationTest method removeBanForMemberCorrectly.
@Test
public void removeBanForMemberCorrectly() throws Exception {
System.out.println(CLASS_NAME + "removeBanForMemberCorrectly");
Vo createdVo = vosManagerEntry.createVo(sess, myVo);
Member member = createMemberFromExtSource(createdVo);
BanOnVo ban = new BanOnVo();
ban.setMemberId(member.getId());
vosManagerEntry.setBan(sess, ban);
vosManagerEntry.removeBanForMember(sess, member);
assertThat(vosManagerEntry.getBanForMember(sess, member)).isNull();
}
use of cz.metacentrum.perun.core.api.BanOnVo in project perun by CESNET.
the class VosManagerEntryIntegrationTest method getBanForMemberCorrectly.
@Test
public void getBanForMemberCorrectly() throws Exception {
System.out.println(CLASS_NAME + "getBanForMemberCorrectly");
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.getBanForMember(sess, member);
assertThat(foundBan).isEqualToIgnoringNullFields(ban);
}
Aggregations