// Path: src/main/java/com/sonymobile/tools/gerrit/gerritevents/dto/GerritEventKeys.java
// public static final String NUMBER = "number";
// 
// Path: src/main/java/com/sonymobile/tools/gerrit/gerritevents/dto/GerritEventKeys.java
// public static final String REF = "ref";
// 
// Path: src/main/java/com/sonymobile/tools/gerrit/gerritevents/dto/GerritEventKeys.java
// public static final String REVISION = "revision";
// 
// Path: src/main/java/com/sonymobile/tools/gerrit/gerritevents/dto/GerritEventKeys.java
// public static final String CREATED_ON = "createdOn";


import static com.sonymobile.tools.gerrit.gerritevents.dto.GerritEventKeys.NUMBER;
import static com.sonymobile.tools.gerrit.gerritevents.dto.GerritEventKeys.REF;
import static com.sonymobile.tools.gerrit.gerritevents.dto.GerritEventKeys.REVISION;
import static com.sonymobile.tools.gerrit.gerritevents.dto.GerritEventKeys.CREATED_ON;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import net.sf.json.JSONObject;
import org.junit.Test;
import java.util.Date;
import java.util.concurrent.TimeUnit;
     * Without "isDraft" in the JSON data.
     * @throws Exception if so.
     */
    @Test
    public void testFromJsonNoIsDraft() throws Exception {
        JSONObject json = new JSONObject();
        json.put(NUMBER, "2");
        json.put(REVISION, "ad123456789");
        PatchSet patchSet = new PatchSet();
        patchSet.fromJson(json);

        assertEquals("2", patchSet.getNumber());
        assertEquals("ad123456789", patchSet.getRevision());
        assertNull(patchSet.getRef());
        assertEquals(false, patchSet.isDraft());
    }

    /**
     * Test {@link PatchSet#PatchSet(net.sf.json.JSONObject)}.
     * @throws Exception if so.
     */
    @Test
    public void testInitFromJson() throws Exception {
        JSONObject json = new JSONObject();
        json.put(NUMBER, "2");
        json.put(REVISION, "ad123456789");
        json.put(REF, "refs/changes/00/100/2");
        json.put("isDraft", true);
        PatchSet patchSet = new PatchSet(json);

// Path: src/main/java/com/sonymobile/tools/gerrit/gerritevents/dto/GerritEventKeys.java
// public static final String NUMBER = "number";
// 
// Path: src/main/java/com/sonymobile/tools/gerrit/gerritevents/dto/GerritEventKeys.java
// public static final String REF = "ref";
// 
// Path: src/main/java/com/sonymobile/tools/gerrit/gerritevents/dto/GerritEventKeys.java
// public static final String REVISION = "revision";
// 
// Path: src/main/java/com/sonymobile/tools/gerrit/gerritevents/dto/GerritEventKeys.java
// public static final String CREATED_ON = "createdOn";


// Path: src/test/java/com/sonymobile/tools/gerrit/gerritevents/dto/attr/PatchSetTest.java
import static com.sonymobile.tools.gerrit.gerritevents.dto.GerritEventKeys.NUMBER;
import static com.sonymobile.tools.gerrit.gerritevents.dto.GerritEventKeys.REF;
import static com.sonymobile.tools.gerrit.gerritevents.dto.GerritEventKeys.REVISION;
import static com.sonymobile.tools.gerrit.gerritevents.dto.GerritEventKeys.CREATED_ON;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import net.sf.json.JSONObject;
import org.junit.Test;
import java.util.Date;
import java.util.concurrent.TimeUnit;

     * Without "isDraft" in the JSON data.
     * @throws Exception if so.
     */
    @Test
    public void testFromJsonNoIsDraft() throws Exception {
        JSONObject json = new JSONObject();
        json.put(NUMBER, "2");
        json.put(REVISION, "ad123456789");
        PatchSet patchSet = new PatchSet();
        patchSet.fromJson(json);

        assertEquals("2", patchSet.getNumber());
        assertEquals("ad123456789", patchSet.getRevision());
        assertNull(patchSet.getRef());
        assertEquals(false, patchSet.isDraft());
    }

    /**
     * Test {@link PatchSet#PatchSet(net.sf.json.JSONObject)}.
     * @throws Exception if so.
     */
    @Test
    public void testInitFromJson() throws Exception {
        JSONObject json = new JSONObject();
        json.put(NUMBER, "2");
        json.put(REVISION, "ad123456789");
        json.put(REF, "refs/changes/00/100/2");
        json.put("isDraft", true);
        PatchSet patchSet = new PatchSet(json);

        assertEquals("2", patchSet.getNumber());