public class JSONSerializerTest {
@Test
public void testSerializeAllProperties() throws Exception {
// given
TestResource testResource = new TestResource();
Serializer<JSONObject> jsonSerializer = new JSONSerializer();
ResourceShape resourceShape = new ResourceShape();
resourceShape.setProperties(TestResource.ALL_PROPERTIES);
// when
JSONObject jsonObject = jsonSerializer.serialize(testResource, resourceShape);
String jsonString = jsonObject.toString();
jsonObject = new JSONObject(jsonString);
// then
assertEquals(testResource.getName(), jsonObject.getString(TestResource.STRING_PROPERTY_NAME));