Package com.cumulocity.model.idtype

Examples of com.cumulocity.model.idtype.GId


        identityApiImpl.getExternalIdsOfGlobalId(gid);
    }

    @Test(expected = SDKException.class)
    public void shouldThrowExceptionWhenGlobalIdWithNullValue() throws SDKException {
        identityApiImpl.getExternalIdsOfGlobalId(new GId(null));
    }
View Full Code Here


    }

    @Test
    public void testGetExternalIdsForGId() throws Exception {
        // Given
        GId gid = new GId("10");
        identityApiRep.setExternalIdsOfGlobalId(TEMPLATE_URL);
        when(templateUrlParser.replacePlaceholdersWithParams(TEMPLATE_URL, singletonMap("globalId", "10"))).thenReturn(EXACT_URL);

        ExternalIDCollection expected = new ExternalIDCollectionImpl(restConnector, EXACT_URL,
                DEFAULT_PAGE_SIZE);
View Full Code Here

    @Test
    public void shouldCreate() throws Exception {
        // Given
        ManagedObjectRepresentation mo = new ManagedObjectRepresentation();
        String globalIdValue = "myGlobalIdValue";
        mo.setId(new GId(globalIdValue));

        ExternalIDRepresentation repToCreate = new ExternalIDRepresentation();
        repToCreate.setManagedObject(mo);

        ExternalIDRepresentation createdRep = new ExternalIDRepresentation();
View Full Code Here

public class EventFilterTest {

    @Test
    public void shouldHoldTypeAndSource() throws Exception {
        EventFilter filter = new EventFilter().byType("type").bySource(new GId("1"));
        assertThat(filter.getType(), is("type"));
        assertThat(filter.getSource(), is("1"));
    }
View Full Code Here

    @Test
    public void shouldGet() throws Exception {
        // Given
        String gidValue = "10";
        GId gid = new GId(gidValue);
        EventRepresentation retrieved = new EventRepresentation();
        when(restConnector.get(EVENTS_COLLECTION_URL + "/" + gidValue, EventMediaType.EVENT, EventRepresentation.class)).thenReturn(
                retrieved);

        // When
View Full Code Here

    @Test
    public void shouldDelete() throws Exception {
        // Given
        String gidValue = "10";
        GId gid = new GId(gidValue);
        EventRepresentation eventToDelete = new EventRepresentation();
        eventToDelete.setId(gid);

        // When
        eventApi.delete(eventToDelete);
View Full Code Here

    @Before
    public void setup() throws Exception {
        MockitoAnnotations.initMocks(this);
        measurementApi = new MeasurementApiImpl(restConnector, urlProcessor, measurementsApiRepresentation, DEAFAULT_PAGE_SIZE);
        source.setId(new GId(SOURCE_GID));
        measurementCollectionRepresentation.setSelf(MEASUREMENT_COLLECTION_URL);
        measurementsApiRepresentation.setMeasurements(measurementCollectionRepresentation);
    }
View Full Code Here

    @Test
    public void shouldReturnMeasurementRep() throws SDKException {
        // Given
        String gidValue = "123";
        GId gid = new GId(gidValue);

        MeasurementRepresentation meas = new MeasurementRepresentation();
        when(
                restConnector.get(MEASUREMENT_COLLECTION_URL + "/" + gidValue, MeasurementMediaType.MEASUREMENT,
                        MeasurementRepresentation.class)).thenReturn(meas);
View Full Code Here

    @Test
    public void shouldDeleteMeasurementRep() throws SDKException {
        // Given
        String gidValue = "123";
        GId gid = new GId(gidValue);
        MeasurementRepresentation meas = new MeasurementRepresentation();
        meas.setId(gid);

        //when
        measurementApi.deleteMeasurement(meas);
View Full Code Here

    }

    @Given("I have the global id '(\\d+)' with following external ids:")
    public void iHaveManagedObject(long globalId, List<Row> rows) {
        ManagedObjectRepresentation mo = new ManagedObjectRepresentation();
        GId gId = new GId();
        gId.setValue(Long.toString(globalId));
        mo.setId(gId);

        for (Row row : rows) {
            ExternalIDRepresentation rep = new ExternalIDRepresentation();
            rep.setExternalId(row.value);
View Full Code Here

TOP

Related Classes of com.cumulocity.model.idtype.GId

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.