@Test
    void verifyBulkImportAsZip() throws Throwable {
        mockMvc.perform(delete("/actuator/events")
                .with(csrf())
                .contentType(MediaType.APPLICATION_FORM_URLENCODED)
                .accept(MediaType.APPLICATION_JSON)
                .headers(HttpUtils.createBasicAuthHeaders("casuser", "Mellon"))
            )
            .andExpect(status().isOk());

        try (val out = new ByteArrayOutputStream(2048);
             val zipStream = new ZipOutputStream(out)) {
            val event = new CasEvent()
                .setId(System.currentTimeMillis())
                .setPrincipalId("casuser")
                .putEventId(UUID.randomUUID().toString())
                .setType(CasAuthenticationTransactionFailureEvent.class.getSimpleName())
                .putClientIpAddress("127.0.0.1")
                .putServerIpAddress("127.0.0.2")
                .putAgent("Firefox")
                .setCreationTime(ZonedDateTime.now(Clock.systemUTC()).toInstant())
                .putTimestamp(System.currentTimeMillis());
            val content = MAPPER.writeValueAsString(event);
            val name = event.getEventId() + ".json";
            val entry = new ZipEntry(name);
            zipStream.putNextEntry(entry);

            val data = content.getBytes(StandardCharsets.UTF_8);
            zipStream.write(data, 0, data.length);
            zipStream.closeEntry();

            mockMvc.perform(post("/actuator/events")
                    .with(csrf())
                    .content(out.toByteArray())
                    .contentType(MediaType.APPLICATION_OCTET_STREAM_VALUE)
                    .accept(MediaType.APPLICATION_JSON)
                    .headers(HttpUtils.createBasicAuthHeaders("casuser", "Mellon"))
                )
                .andExpect(status().isOk());
        }
    }
This is {@link CasEventsReportEndpointTests}.

@author Misagh Moayyed
@since 6.2.0
core/cas-server-core-events/src/test/java/org/apereo/cas/support/events/CasEventsReportEndpointTests.java