Search in sources :

Example 21 with BanOnVo

use of cz.metacentrum.perun.core.api.BanOnVo in project perun by CESNET.

the class VosManagerImplIntegrationTest method setBan.

@Test
public void setBan() throws Exception {
    System.out.println(CLASS_NAME + "setBan");
    BanOnVo originBan = new BanOnVo(-1, member.getId(), vo.getId(), new Date(), "noob");
    originBan = vosManagerImpl.setBan(sess, originBan);
    BanOnVo actualBan = vosManagerImpl.getBanForMember(sess, originBan.getMemberId());
    assertThat(originBan).isEqualTo(actualBan);
}
Also used : BanOnVo(cz.metacentrum.perun.core.api.BanOnVo) Date(java.util.Date) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 22 with BanOnVo

use of cz.metacentrum.perun.core.api.BanOnVo in project perun by CESNET.

the class VosManagerImplIntegrationTest method testUpdateBan.

private void testUpdateBan(Consumer<BanOnVo> banChange) throws Exception {
    BanOnVo originBan = new BanOnVo(-1, member.getId(), vo.getId(), new Date(), "noob");
    originBan = vosManagerImpl.setBan(sess, originBan);
    originBan = vosManagerImpl.getBanById(sess, originBan.getId());
    banChange.accept(originBan);
    vosManagerImpl.updateBan(sess, originBan);
    BanOnVo updatedBan = vosManagerImpl.getBanById(sess, originBan.getId());
    assertThat(updatedBan).isEqualByComparingTo(originBan);
}
Also used : BanOnVo(cz.metacentrum.perun.core.api.BanOnVo) Date(java.util.Date)

Aggregations

BanOnVo (cz.metacentrum.perun.core.api.BanOnVo)22 AbstractPerunIntegrationTest (cz.metacentrum.perun.core.AbstractPerunIntegrationTest)13 Test (org.junit.Test)13 Member (cz.metacentrum.perun.core.api.Member)9 Vo (cz.metacentrum.perun.core.api.Vo)8 Date (java.util.Date)8 MemberNotExistsException (cz.metacentrum.perun.core.api.exceptions.MemberNotExistsException)3 PrivilegeException (cz.metacentrum.perun.core.api.exceptions.PrivilegeException)3 BanOnResource (cz.metacentrum.perun.core.api.BanOnResource)2 BanNotExistsException (cz.metacentrum.perun.core.api.exceptions.BanNotExistsException)2 InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)2 LocalDate (java.time.LocalDate)2 MemberUnsuspended (cz.metacentrum.perun.audit.events.MembersManagerEvents.MemberUnsuspended)1 Attribute (cz.metacentrum.perun.core.api.Attribute)1 Facility (cz.metacentrum.perun.core.api.Facility)1 Resource (cz.metacentrum.perun.core.api.Resource)1 RichMember (cz.metacentrum.perun.core.api.RichMember)1 User (cz.metacentrum.perun.core.api.User)1 BanAlreadyExistsException (cz.metacentrum.perun.core.api.exceptions.BanAlreadyExistsException)1 ConsistencyErrorException (cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException)1