@Test
public void toJsonSerializesProperly() throws JSONException {
ScopeSelftestResult.Builder builder = ScopeSelftestResult.builder();
ScopeSelftestResult expected = (ScopeSelftestResult) builder
.setTestName("name")
.setGroupName("group")
.setFileName("filename.ot")
.setTestResult(Selftest.SelftestResult.Result.PASS)
.setReason("reason")
.setLineNumber(2)
.build();
JSONObject json = expected.toJson();
assertEquals(expected.getTestName(), json.get("testName"));
assertEquals(expected.getGroupName(), json.get("groupName"));
assertEquals(expected.getFileName(), json.get("fileName"));
assertEquals(expected.getResult(), json.get("result"));
assertEquals(expected.getLineNumber(), json.get("lineNumber"));
}