public static void main(String[] args){
  final ApprovalEventDTO approval=createTestApprovalEvent();
  hudson.model.BuildListener listener=new StreamBuildListener(System.out,Charset.defaultCharset());
  try {
    ObjectMapper mapper=JsonUtils.createObjectMapper();
    String json=mapper.writeValueAsString(approval);
    boolean success=ElasticsearchClient.updateEvent("AVVy4MSZ_YLNT2M2J-83",json,ElasticsearchClient.APPROVE,listener);
    assertTrue(success);
  }
 catch (  Exception e) {
    LOG.log(Level.SEVERE,"Error when updating event: " + approval,e);
  }
}

public static void main ( String [ ] args ) { final ApprovalEventDTO approval = createTestApprovalEvent ( ) ; hudson . model . BuildListener listener = new StreamBuildListener ( System . out , Charset . defaultCharset ( ) ) ; try { ObjectMapper mapper = JsonUtils . createObjectMapper ( ) ; String json = mapper . writeValueAsString ( approval ) ; boolean success = ElasticsearchClient . updateEvent ( "AVVy4MSZ_YLNT2M2J-83" , json , ElasticsearchClient . APPROVE , listener ) ; assertTrue ( success ) ; } catch ( Exception e ) { LOG . log ( Level . SEVERE , "Error when updating event: " + approval , e ) ; } }
java main to test updating events in elasticsearch . set the following env vars to point to a local es running in openshift pipeline_elasticsearch_host = elasticsearch . vagrant . f8 elasticsearch_service_port = 80
