PointerEncoder extends PointerOrLocalIdEncoder { public static PointerEncoder get() { return INSTANCE; }  static PointerEncoder get(); @Override JSONObject encodeRelatedObject(ParseObject object);  }
@Test public void testEncodeRelatedObjectWithoutObjectId() { thrown.expect(IllegalStateException.class); thrown.expectMessage("unable to encode an association with an unsaved ParseObject"); ParseObject parseObject = new ParseObject("TestObject"); JSONObject jsonObject = (JSONObject) PointerEncoder.get().encode(parseObject); }
@Test public void testEncodeRelatedObjectWithObjectId() { ParseObject parseObject = new ParseObject("TestObject"); parseObject.setObjectId("1234"); JSONObject jsonObject = (JSONObject) PointerEncoder.get().encode(parseObject); assertNotNull(jsonObject); }