// Path: src/main/java/org/grouchotools/jsrules/config/ResponseConfig.java
// public class ResponseConfig extends JsonBean implements Config {
//     private String response;
//     private String responseClass;
// 
//     public ResponseConfig() {
// 
//     }
// 
//     public ResponseConfig(String response, String responseClass) {
//          this.response = response;
//          this.responseClass = responseClass;
//     }
// 
//     public String getResponse() {
//         return response;
//     }
// 
//     public void setResponse(String response) {
//         this.response = response;
//     }
// 
//     public String getResponseClass() {
//         return responseClass;
//     }
// 
//     public void setResponseClass(String responseClass) {
//         this.responseClass = responseClass;
//     }
//     
// }
// 
// Path: src/main/java/org/grouchotools/jsrules/config/RulesetConfig.java
// public class RulesetConfig implements Config {
//     private String rulesetName;
//     private String rulesetType;
//     private ResponseConfig responseConfig;
//     private List<String> components;
// 
//     public RulesetConfig() {
// 
//     }
// 
//     public RulesetConfig(String rulesetName, String rulesetType, ResponseConfig responseConfig, List<String> components) {
//         this.rulesetName = rulesetName;
//         this.rulesetType = rulesetType;
//         this.responseConfig = responseConfig;
//         this.components = components;
//     }
// 
//     public String getRulesetName() {
//         return rulesetName;
//     }
// 
//     public void setRulesetName(String rulesetName) {
//         this.rulesetName = rulesetName;
//     }
// 
//     public String getRulesetType() {
//         return rulesetType;
//     }
// 
//     public void setRulesetType(String rulesetType) {
//         this.rulesetType = rulesetType;
//     }
// 
//     public ResponseConfig getResponseConfig() {
//         return responseConfig;
//     }
// 
//     public void setResponseConfig(ResponseConfig responseConfig) {
//         this.responseConfig = responseConfig;
//     }
// 
//     public List<String> getComponents() {
//         return components;
//     }
// 
//     public void setComponents(List<String> components) {
//         this.components = components;
//     }
// }
// 
// Path: src/main/java/org/grouchotools/jsrules/exception/InvalidConfigException.java
// public class InvalidConfigException extends JsRulesException {
// 
//     public InvalidConfigException() {
//     }
// 
//     public InvalidConfigException(String message) {
//         super(message);
//     }
// 
//     public InvalidConfigException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public InvalidConfigException(Throwable cause) {
//         super(cause);
//     }
// 
//     public InvalidConfigException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
//         super(message, cause, enableSuppression, writableStackTrace);
//     }
//     
// }


import com.fasterxml.jackson.databind.ObjectMapper;
import org.grouchotools.jsrules.config.ResponseConfig;
import org.grouchotools.jsrules.config.RulesetConfig;
import org.grouchotools.jsrules.exception.InvalidConfigException;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

    @Test
    public void testLoadJsonString() throws Exception {
        String ruleName = "mock rule";

        String json = "{" +
                "\"ruleName\": \"" + ruleName + "\"," +
                "\"leftParamConfig\": {" +
                "\"parameterName\": \"left\"," +
                "\"parameterClass\": \"Long\"" +
                "}," +
                "\"operator\": \"GT\"," +
                "\"rightParamConfig\": {" +
                "\"parameterName\": \"right\"," +
                "\"parameterClass\": \"Long\"," +
                "\"parameterStaticValue\": \"10\"" +
                "}," +
                "\"responseConfig\": {" +
                "\"response\": \"true\"," +
                "\"responseClass\": \"Boolean\"" +
                "}" +
                "}";

        Rule rule = jsRules.loadRuleByJson(json);

        assertEquals(ruleName, rule.getRuleName());
    }

    @Test
    public void testLoadJsonInvalid() throws Exception {
// Path: src/main/java/org/grouchotools/jsrules/config/ResponseConfig.java
// public class ResponseConfig extends JsonBean implements Config {
//     private String response;
//     private String responseClass;
// 
//     public ResponseConfig() {
// 
//     }
// 
//     public ResponseConfig(String response, String responseClass) {
//          this.response = response;
//          this.responseClass = responseClass;
//     }
// 
//     public String getResponse() {
//         return response;
//     }
// 
//     public void setResponse(String response) {
//         this.response = response;
//     }
// 
//     public String getResponseClass() {
//         return responseClass;
//     }
// 
//     public void setResponseClass(String responseClass) {
//         this.responseClass = responseClass;
//     }
//     
// }
// 
// Path: src/main/java/org/grouchotools/jsrules/config/RulesetConfig.java
// public class RulesetConfig implements Config {
//     private String rulesetName;
//     private String rulesetType;
//     private ResponseConfig responseConfig;
//     private List<String> components;
// 
//     public RulesetConfig() {
// 
//     }
// 
//     public RulesetConfig(String rulesetName, String rulesetType, ResponseConfig responseConfig, List<String> components) {
//         this.rulesetName = rulesetName;
//         this.rulesetType = rulesetType;
//         this.responseConfig = responseConfig;
//         this.components = components;
//     }
// 
//     public String getRulesetName() {
//         return rulesetName;
//     }
// 
//     public void setRulesetName(String rulesetName) {
//         this.rulesetName = rulesetName;
//     }
// 
//     public String getRulesetType() {
//         return rulesetType;
//     }
// 
//     public void setRulesetType(String rulesetType) {
//         this.rulesetType = rulesetType;
//     }
// 
//     public ResponseConfig getResponseConfig() {
//         return responseConfig;
//     }
// 
//     public void setResponseConfig(ResponseConfig responseConfig) {
//         this.responseConfig = responseConfig;
//     }
// 
//     public List<String> getComponents() {
//         return components;
//     }
// 
//     public void setComponents(List<String> components) {
//         this.components = components;
//     }
// }
// 
// Path: src/main/java/org/grouchotools/jsrules/exception/InvalidConfigException.java
// public class InvalidConfigException extends JsRulesException {
// 
//     public InvalidConfigException() {
//     }
// 
//     public InvalidConfigException(String message) {
//         super(message);
//     }
// 
//     public InvalidConfigException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public InvalidConfigException(Throwable cause) {
//         super(cause);
//     }
// 
//     public InvalidConfigException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
//         super(message, cause, enableSuppression, writableStackTrace);
//     }
//     
// }


// Path: src/test/java/org/grouchotools/jsrules/JsRulesTest.java
import com.fasterxml.jackson.databind.ObjectMapper;
import org.grouchotools.jsrules.config.ResponseConfig;
import org.grouchotools.jsrules.config.RulesetConfig;
import org.grouchotools.jsrules.exception.InvalidConfigException;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;


    @Test
    public void testLoadJsonString() throws Exception {
        String ruleName = "mock rule";

        String json = "{" +
                "\"ruleName\": \"" + ruleName + "\"," +
                "\"leftParamConfig\": {" +
                "\"parameterName\": \"left\"," +
                "\"parameterClass\": \"Long\"" +
                "}," +
                "\"operator\": \"GT\"," +
                "\"rightParamConfig\": {" +
                "\"parameterName\": \"right\"," +
                "\"parameterClass\": \"Long\"," +
                "\"parameterStaticValue\": \"10\"" +
                "}," +
                "\"responseConfig\": {" +
                "\"response\": \"true\"," +
                "\"responseClass\": \"Boolean\"" +
                "}" +
                "}";

        Rule rule = jsRules.loadRuleByJson(json);

        assertEquals(ruleName, rule.getRuleName());
    }

    @Test
    public void testLoadJsonInvalid() throws Exception {
        exception.expect(InvalidConfigException.class);