// Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
// 
//     @BeforeClass
//     public static void startLocalElasticSearch() {
//         ElasticSearchTestInstance.triggerStaticInit();
//     }
// 
//     /**
//      * Configured to connect to a local ElasticSearch instance created specifically for unit testing
//      */
//     protected Jres jres = new Jres(Suppliers.ofInstance("http://localhost:9201"));
// 
// }
// 
// Path: jres-core/src/main/java/com/blacklocus/jres/request/index/JresCreateIndex.java
// public class JresCreateIndex extends JresJsonRequest<JresAcknowledgedReply> {
// 
//     private final String index;
//     private final Object settings;
// 
//     public JresCreateIndex(String index) {
//         this(index, null);
//     }
// 
//     public JresCreateIndex(String index, String settingsJson) {
//         super(JresAcknowledgedReply.class);
//         this.index = index;
//         this.settings = settingsJson;
//     }
// 
//     @Override
//     public String getHttpMethod() {
//         return HttpPut.METHOD_NAME;
//     }
// 
//     @Override
//     public String getPath() {
//         return index;
//     }
// 
//     @Override
//     public Object getPayload() {
//         return settings;
//     }
// 
// }
// 
// Path: jres-core/src/main/java/com/blacklocus/jres/response/JresBooleanReply.java
// public class JresBooleanReply implements JresReply {
// 
//     private final boolean verity;
// 
//     public JresBooleanReply(boolean verity) {
//         this.verity = verity;
//     }
// 
//     @Override
//     public JsonNode node() {
//         return null;
//     }
// 
//     public boolean verity() {
//         return verity;
//     }
// 
// }
// 
// Path: jres-core/src/main/java/com/blacklocus/jres/response/common/JresAcknowledgedReply.java
// public class JresAcknowledgedReply extends JresJsonReply {
// 
//     private Boolean acknowledged;
// 
//     public Boolean getAcknowledged() {
//         return acknowledged;
//     }
// }
// 
// Path: jres-core/src/main/java/com/blacklocus/jres/response/common/JresErrorReplyException.java
// public class JresErrorReplyException extends RuntimeException implements JresReply {
// 
//     private final String error;
//     private final Integer status;
//     private final JsonNode node;
// 
//     public JresErrorReplyException(String error, Integer status, JsonNode node) {
//         super(error);
//         this.error = error;
//         this.status = status;
//         this.node = node;
//     }
// 
//     @Override
//     public JsonNode node() {
//         return node;
//     }
// 
//     public String getError() {
//         return error;
//     }
// 
//     public Integer getStatus() {
//         return status;
//     }
// 
//     public <T> T asType(Class<T> klass) {
//         return ObjectMappers.fromJson(node, klass);
//     }
// 
//     public <T> T asType(TypeReference<T> typeReference) {
//         return ObjectMappers.fromJson(node, typeReference);
//     }
// }


import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.JresBooleanReply;
import com.blacklocus.jres.response.common.JresAcknowledgedReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.Assert;
import org.junit.Test;
            // good
        }

        jres.quest(new JresCreateIndex(index));

        try {
            jres.quest(new JresPutMapping(index, type, null));
            Assert.fail("Invalid data");
        } catch (JresErrorReplyException e) {
            // good
        }

        try {
            jres.quest(new JresPutMapping(index, type, ""));
            Assert.fail("Invalid data");
        } catch (JresErrorReplyException e) {
            // good
        }

        try {
            jres.quest(new JresPutMapping(index, type, "{}"));
            Assert.fail("Invalid data");
        } catch (JresErrorReplyException e) {
            // good
        }
    }

    @Test
    public void happy() {
        String index = "JresPutMappingRequestTest_happy".toLowerCase();
// Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
// 
//     @BeforeClass
//     public static void startLocalElasticSearch() {
//         ElasticSearchTestInstance.triggerStaticInit();
//     }
// 
//     /**
//      * Configured to connect to a local ElasticSearch instance created specifically for unit testing
//      */
//     protected Jres jres = new Jres(Suppliers.ofInstance("http://localhost:9201"));
// 
// }
// 
// Path: jres-core/src/main/java/com/blacklocus/jres/request/index/JresCreateIndex.java
// public class JresCreateIndex extends JresJsonRequest<JresAcknowledgedReply> {
// 
//     private final String index;
//     private final Object settings;
// 
//     public JresCreateIndex(String index) {
//         this(index, null);
//     }
// 
//     public JresCreateIndex(String index, String settingsJson) {
//         super(JresAcknowledgedReply.class);
//         this.index = index;
//         this.settings = settingsJson;
//     }
// 
//     @Override
//     public String getHttpMethod() {
//         return HttpPut.METHOD_NAME;
//     }
// 
//     @Override
//     public String getPath() {
//         return index;
//     }
// 
//     @Override
//     public Object getPayload() {
//         return settings;
//     }
// 
// }
// 
// Path: jres-core/src/main/java/com/blacklocus/jres/response/JresBooleanReply.java
// public class JresBooleanReply implements JresReply {
// 
//     private final boolean verity;
// 
//     public JresBooleanReply(boolean verity) {
//         this.verity = verity;
//     }
// 
//     @Override
//     public JsonNode node() {
//         return null;
//     }
// 
//     public boolean verity() {
//         return verity;
//     }
// 
// }
// 
// Path: jres-core/src/main/java/com/blacklocus/jres/response/common/JresAcknowledgedReply.java
// public class JresAcknowledgedReply extends JresJsonReply {
// 
//     private Boolean acknowledged;
// 
//     public Boolean getAcknowledged() {
//         return acknowledged;
//     }
// }
// 
// Path: jres-core/src/main/java/com/blacklocus/jres/response/common/JresErrorReplyException.java
// public class JresErrorReplyException extends RuntimeException implements JresReply {
// 
//     private final String error;
//     private final Integer status;
//     private final JsonNode node;
// 
//     public JresErrorReplyException(String error, Integer status, JsonNode node) {
//         super(error);
//         this.error = error;
//         this.status = status;
//         this.node = node;
//     }
// 
//     @Override
//     public JsonNode node() {
//         return node;
//     }
// 
//     public String getError() {
//         return error;
//     }
// 
//     public Integer getStatus() {
//         return status;
//     }
// 
//     public <T> T asType(Class<T> klass) {
//         return ObjectMappers.fromJson(node, klass);
//     }
// 
//     public <T> T asType(TypeReference<T> typeReference) {
//         return ObjectMappers.fromJson(node, typeReference);
//     }
// }


// Path: jres-test/src/test/java/com/blacklocus/jres/request/mapping/JresPutMappingTest.java
import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.JresBooleanReply;
import com.blacklocus.jres.response.common.JresAcknowledgedReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.Assert;
import org.junit.Test;

            // good
        }

        jres.quest(new JresCreateIndex(index));

        try {
            jres.quest(new JresPutMapping(index, type, null));
            Assert.fail("Invalid data");
        } catch (JresErrorReplyException e) {
            // good
        }

        try {
            jres.quest(new JresPutMapping(index, type, ""));
            Assert.fail("Invalid data");
        } catch (JresErrorReplyException e) {
            // good
        }

        try {
            jres.quest(new JresPutMapping(index, type, "{}"));
            Assert.fail("Invalid data");
        } catch (JresErrorReplyException e) {
            // good
        }
    }

    @Test
    public void happy() {
        String index = "JresPutMappingRequestTest_happy".toLowerCase();
        String type = "test";