@Test
    void verifyBulkImportAsZip() throws Throwable {
        try (val out = new ByteArrayOutputStream(2048);
             val zipStream = new ZipOutputStream(out)) {
            val registeredService = RegisteredServiceTestUtils.getRegisteredService();
            val content = new RegisteredServiceJsonSerializer(applicationContext).toString(registeredService);
            val name = registeredService.getName() + ".json";
            val zipEntry = new ZipEntry(name);
            zipStream.putNextEntry(zipEntry);

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

            mockMvc.perform(post("/actuator/registeredServices/import")
                    .contentType(MediaType.APPLICATION_OCTET_STREAM_VALUE)
                    .accept(MediaType.APPLICATION_JSON)
                    .content(out.toByteArray())
                )
                .andExpect(status().isOk());
        }
    }
This is {@link RegisteredServicesEndpointTests}.

@author Misagh Moayyed
@since 6.1.0
support/cas-server-support-reports/src/test/java/org/apereo/cas/web/report/RegisteredServicesEndpointTests.java