@Test
    void verifyImportOperationAsJson() throws Throwable {
        val event = new CasEvent()
            .setId(System.currentTimeMillis())
            .setPrincipalId("casuser")
            .setType(CasAuthenticationTransactionFailureEvent.class.getSimpleName())
            .putClientIpAddress("127.0.0.1")
            .putServerIpAddress("127.0.0.2")
            .putAgent("Firefox")
            .putTimestamp(System.currentTimeMillis());
        val content = MAPPER.writeValueAsString(event);

        mockMvc.perform(post("/actuator/events")
                .with(csrf())
                .content(content)
                .contentType(MediaType.APPLICATION_FORM_URLENCODED)
                .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