package sk.tomsik68.mclauncher.impl.versions.mcdownload;

import net.minidev.json.JSONObject;
import net.minidev.json.JSONValue;
import org.junit.Before;
import org.junit.Test;

public final class TestRuleParser {

    @Test
    public void parseRuleWithFeatures() {
        String r = "{ \"action\": \"allow\", \"features\": { \"has_custom_resolution\": true } }";
        Rule rule = new Rule((JSONObject) JSONValue.parse(r));
    }

    @Test
    public void parseRuleWithOS() {
        String r = "{\n" + "            \"action\": \"allow\",\n" + "            \"os\": {\n" + "              \"name\": \"osx\"\n" + "            }\n" + "          }\n";
        Rule rule = new Rule((JSONObject) JSONValue.parse(r));
    }

    @Test
    public void parseRuleWithArch() {
        String r = "{ \"action\": \"allow\", \"os\": { \"arch\": \"x86\" } }";
        Rule rule = new Rule((JSONObject) JSONValue.parse(r));
    }
}

@@ -375,32 +375,37 @@
 Rule rule = 
-new 
 Rule
+.fromJson
 ((JSONObject
@@ -667,32 +667,37 @@
 Rule rule = 
-new 
 Rule
+.fromJson
 ((JSONObject
@@ -877,16 +877,21 @@
 e = 
-new 
 Rule
+.fromJson
 ((JS

Fix Rule unit tests