Search in sources :

Example 6 with StringMessageEvent

use of cz.metacentrum.perun.audit.events.StringMessageEvent in project perun by CESNET.

the class AuditMessagesManagerEntryIntegrationTest method getMessagesPage_oneOfMany.

@Test
public void getMessagesPage_oneOfMany() throws Exception {
    System.out.println(CLASS_NAME + "getMessagesPage_oneOfMany");
    perun.getAuditer().logWithoutTransaction(sess, new StringMessageEvent("Test older"));
    perun.getAuditer().logWithoutTransaction(sess, new StringMessageEvent("Test newer"));
    MessagesPageQuery query = new MessagesPageQuery(1, 0, SortingOrder.DESCENDING);
    Paginated<AuditMessage> messages = perun.getAuditMessagesManager().getMessagesPage(sess, query);
    assertThat(messages.getData().size()).isEqualTo(1);
    assertThat(messages.getData().get(0).getEvent().getMessage()).isEqualTo("Test newer");
}
Also used : AuditMessage(cz.metacentrum.perun.core.api.AuditMessage) StringMessageEvent(cz.metacentrum.perun.audit.events.StringMessageEvent) MessagesPageQuery(cz.metacentrum.perun.core.api.MessagesPageQuery) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Aggregations

StringMessageEvent (cz.metacentrum.perun.audit.events.StringMessageEvent)6 AbstractPerunIntegrationTest (cz.metacentrum.perun.core.AbstractPerunIntegrationTest)6 AuditMessage (cz.metacentrum.perun.core.api.AuditMessage)6 Test (org.junit.Test)6 MessagesPageQuery (cz.metacentrum.perun.core.api.MessagesPageQuery)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 AuditEvent (cz.metacentrum.perun.audit.events.AuditEvent)1 SponsorshipExpired (cz.metacentrum.perun.audit.events.ExpirationNotifScheduler.SponsorshipExpired)1 FacilityCreated (cz.metacentrum.perun.audit.events.FacilityManagerEvents.FacilityCreated)1 SponsorshipEstablished (cz.metacentrum.perun.audit.events.MembersManagerEvents.SponsorshipEstablished)1 AuditMessagesManager (cz.metacentrum.perun.core.api.AuditMessagesManager)1 EnrichedSponsorship (cz.metacentrum.perun.core.api.EnrichedSponsorship)1 Facility (cz.metacentrum.perun.core.api.Facility)1 Paginated (cz.metacentrum.perun.core.api.Paginated)1 SortingOrder (cz.metacentrum.perun.core.api.SortingOrder)1 WrongRangeOfCountException (cz.metacentrum.perun.core.api.exceptions.WrongRangeOfCountException)1 AuditMessagesManagerImpl (cz.metacentrum.perun.core.impl.AuditMessagesManagerImpl)1 LocalDate (java.time.LocalDate)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1