Package com.cumulocity.me.rest.representation.identity

Examples of com.cumulocity.me.rest.representation.identity.ExternalIDCollectionRepresentation


        converter.setJsonConversionService(conversionService);
    }
   
    @Test
    public void shouldFormatEmptyRepresentation() throws Exception {
        JSONObject json = converter.toJson(new ExternalIDCollectionRepresentation());
       
        assertThat(json.toString()).isEqualTo("{\"externalIds\":[]}");
    }
View Full Code Here


    @Test
    public void shouldParseWithExternalId() throws Exception {
        when(conversionService.fromJson(jsonObject("{\"externalId\":\"some_id\",\"type\":\"some_type\"}"), same(ExternalIDRepresentation.class))).thenReturn(externalId);
        JSONObject json = new JSONObject("{\"externalIds\":[{\"externalId\":\"some_id\",\"type\":\"some_type\"}]}");
       
        ExternalIDCollectionRepresentation parsed = (ExternalIDCollectionRepresentation) converter.fromJson(json);
       
        assertThat(parsed.getExternalIds().size()).isEqualTo(1);
        assertThat(parsed.getExternalIds().get(0)).isSameAs(externalId);
    }
View Full Code Here

        converter.isValid(representation.build(), CREATE);
    }
   
    @Test(expected = RepresentationValidationException.class)
    public void shouldRequireNullDeviceExternalIDs() throws Exception {
        representation.with(new ExternalIDCollectionRepresentation());
       
        converter.isValid(representation.build(), CREATE);
    }
View Full Code Here

        converter.isValid(representation.build(), UPDATE);
    }
   
    @Test(expected = RepresentationValidationException.class)
    public void shouldRequireNullDeviceExtIdsUpdate() throws Exception {
        representation.with(new ExternalIDCollectionRepresentation());

        converter.isValid(representation.build(), UPDATE);
    }
View Full Code Here

TOP

Related Classes of com.cumulocity.me.rest.representation.identity.ExternalIDCollectionRepresentation

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.