public synchronized boolean sendHttpEvent(SplunkEvent event) {
    return sendHttpEvents(Collections.singletonList(event));
  }
@Test
  public void testSendHttpEventsShouldThrowErrorWhenHttpClientReturnsErrorCode()
      throws IOException {
    SplunkEvent event = SplunkEvent.newBuilder().withEvent(EVENT).create();

    try (CloseableHttpResponse mockResponse =
        clientFactory.getHttpClient().execute(any(HttpPost.class))) {
      when(mockResponse.getStatusLine().getStatusCode()).thenReturn(404);
    }

    assertThrows(SplunkResourceManagerException.class, () -> testManager.sendHttpEvent(event));
  }