// Path: eventstore-client/src/main/java/de/qyotta/eventstore/utils/Constants.java
// public static final String ES_HARD_DELETE_HEADER = "ES-HardDelete";
// 
// Path: eventstore-client/src/main/java/de/qyotta/eventstore/communication/EsContextDefaultImpl.java
// public class EsContextDefaultImpl implements ESContext {
// 
//    private final CloseableHttpClient httpclient;
//    private final ESReader reader;
//    private final EventStoreSettings settings;
//    private final ESWriter writer;
// 
//    public EsContextDefaultImpl(final EventStoreSettings settings) {
//       this.settings = settings;
//       httpclient = HttpClientFactory.httpClient(settings);
// 
//       reader = new EsReaderDefaultImpl(httpclient);
//       writer = new EsWriterDefaultImpl(httpclient);
//    }
// 
//    @Override
//    public ESReader getReader() {
//       return reader;
//    }
// 
//    @Override
//    public EventStoreSettings getSettings() {
//       return settings;
//    }
// 
//    @Override
//    public ESWriter getWriter() {
//       return writer;
//    }
// 
// }
// 
// Path: eventstore-client/src/main/java/de/qyotta/eventstore/model/Event.java
// @Getter
// @Setter
// @Builder(toBuilder = true)
// @ToString
// @EqualsAndHashCode
// @NoArgsConstructor(access = AccessLevel.PUBLIC)
// @AllArgsConstructor(access = AccessLevel.PUBLIC)
// public class Event {
//    private String eventId;
//    private String eventType;
//    private Long eventNumber;
//    private String streamId;
//    private Boolean isLinkMetaData;
//    private Long positionEventNumber;
//    private String positionStreamId;
//    private String title;
//    private String id;
//    private String updated;
//    private Author author;
//    private String summary;
// 
//    private String eventStreamId;
//    private String data;
//    private String metadata;
// }


import static com.jayway.restassured.RestAssured.given;
import static de.qyotta.eventstore.utils.Constants.ES_HARD_DELETE_HEADER;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.UUID;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.gson.Gson;
import com.jayway.restassured.RestAssured;
import de.qyotta.eventstore.communication.EsContextDefaultImpl;
import de.qyotta.eventstore.model.Event;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
      streamUrl = BASE_STREAMS_URL + streamName;
      expectedEvents = new HashMap<>();
   }

   protected static void deleteStream(final String streamUrl) {
      final int statusCode = given().headers(ES_HARD_DELETE_HEADER, true)
            .when()
            .delete(streamUrl)
            .andReturn()
            .statusCode();
      LOGGER.warn("Deleting stream '" + streamUrl + "' returned status code: " + statusCode);
   }

   @Getter
   @ToString
   @EqualsAndHashCode
   @NoArgsConstructor(access = AccessLevel.PUBLIC)
   @AllArgsConstructor(access = AccessLevel.PUBLIC)
   public static final class MyEvent {
      private String value;
   }

   protected static String metaData() {
      return new Gson().toJson(METADATA);
   }

   protected void createEvents(int numberOfEvents) throws InterruptedException {
      for (int i = 0; i < numberOfEvents; i++) {
         final String eventUuid = UUID.randomUUID()
               .toString();
// Path: eventstore-client/src/main/java/de/qyotta/eventstore/utils/Constants.java
// public static final String ES_HARD_DELETE_HEADER = "ES-HardDelete";
// 
// Path: eventstore-client/src/main/java/de/qyotta/eventstore/communication/EsContextDefaultImpl.java
// public class EsContextDefaultImpl implements ESContext {
// 
//    private final CloseableHttpClient httpclient;
//    private final ESReader reader;
//    private final EventStoreSettings settings;
//    private final ESWriter writer;
// 
//    public EsContextDefaultImpl(final EventStoreSettings settings) {
//       this.settings = settings;
//       httpclient = HttpClientFactory.httpClient(settings);
// 
//       reader = new EsReaderDefaultImpl(httpclient);
//       writer = new EsWriterDefaultImpl(httpclient);
//    }
// 
//    @Override
//    public ESReader getReader() {
//       return reader;
//    }
// 
//    @Override
//    public EventStoreSettings getSettings() {
//       return settings;
//    }
// 
//    @Override
//    public ESWriter getWriter() {
//       return writer;
//    }
// 
// }
// 
// Path: eventstore-client/src/main/java/de/qyotta/eventstore/model/Event.java
// @Getter
// @Setter
// @Builder(toBuilder = true)
// @ToString
// @EqualsAndHashCode
// @NoArgsConstructor(access = AccessLevel.PUBLIC)
// @AllArgsConstructor(access = AccessLevel.PUBLIC)
// public class Event {
//    private String eventId;
//    private String eventType;
//    private Long eventNumber;
//    private String streamId;
//    private Boolean isLinkMetaData;
//    private Long positionEventNumber;
//    private String positionStreamId;
//    private String title;
//    private String id;
//    private String updated;
//    private Author author;
//    private String summary;
// 
//    private String eventStreamId;
//    private String data;
//    private String metadata;
// }


// Path: eventstore-client/src/test/java/de/qyotta/eventstore/AbstractEsTest.java
import static com.jayway.restassured.RestAssured.given;
import static de.qyotta.eventstore.utils.Constants.ES_HARD_DELETE_HEADER;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.UUID;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.gson.Gson;
import com.jayway.restassured.RestAssured;
import de.qyotta.eventstore.communication.EsContextDefaultImpl;
import de.qyotta.eventstore.model.Event;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;

      streamUrl = BASE_STREAMS_URL + streamName;
      expectedEvents = new HashMap<>();
   }

   protected static void deleteStream(final String streamUrl) {
      final int statusCode = given().headers(ES_HARD_DELETE_HEADER, true)
            .when()
            .delete(streamUrl)
            .andReturn()
            .statusCode();
      LOGGER.warn("Deleting stream '" + streamUrl + "' returned status code: " + statusCode);
   }

   @Getter
   @ToString
   @EqualsAndHashCode
   @NoArgsConstructor(access = AccessLevel.PUBLIC)
   @AllArgsConstructor(access = AccessLevel.PUBLIC)
   public static final class MyEvent {
      private String value;
   }

   protected static String metaData() {
      return new Gson().toJson(METADATA);
   }

   protected void createEvents(int numberOfEvents) throws InterruptedException {
      for (int i = 0; i < numberOfEvents; i++) {
         final String eventUuid = UUID.randomUUID()
               .toString();
         final Event event = Event.builder()