Package com.cumulocity.me.rest.json

Examples of com.cumulocity.me.rest.json.JSONObject


        assertThat(json.toString()).isEqualTo("{\"com_cumulocity_me_rest_convert_TestFragment\":{\"type\":\"test\"},\"id\":\"testid\"}");
    }
   
    @Test
    public void shouldParseWithDeviceIds() throws Exception {
        JSONObject json = new JSONObject("{\"creationTime\":\"2001-01-01T00:00:01.0Z\",\"status\":\"some_status\",\"deviceId\":\"deviceId\",\"failureReason\":\"some_failure_reason\",\"id\":\"testid\"}");
       
        OperationRepresentation parsed = (OperationRepresentation) converter.fromJson(json);
       
        assertThat(parsed.getId()).isEqualTo(id);
        assertThat(parsed.getDeviceId()).isEqualTo(deviceId);
View Full Code Here


    }
   
    @Test
    public void shouldParseWithFragment() throws Exception {
        when(conversionService.fromJson(jsonObject("{\"type\":\"test\"}"), same(TestFragment.class))).thenReturn(fragment);
        JSONObject json = new JSONObject("{\"com_cumulocity_me_rest_convert_TestFragment\":{\"type\":\"test\"},\"id\":\"testid\"}");
       
        OperationRepresentation parsed = (OperationRepresentation) converter.fromJson(json);
       
        assertThat(parsed.getId()).isEqualTo(id);
        assertThat(parsed.getAttrs().size()).isEqualTo(1);
View Full Code Here

TOP

Related Classes of com.cumulocity.me.rest.json.JSONObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.