Package com.cumulocity.model.idtype

Examples of com.cumulocity.model.idtype.GId


    @Test
    public void shouldUpdateAlarmRep() throws SDKException {
        //Given
        AlarmRepresentation alarmToUpdate = new AlarmRepresentation();
        alarmToUpdate.setId(new GId("global_id"));
        alarmToUpdate.setStatus("STATUS");
        AlarmRepresentation alarmRep = new AlarmRepresentation();
        when(
                restConnector.put(eq(ALARM_COLLECTION_URL + "/global_id"), eq(AlarmMediaType.ALARM),
                        argThat(hasOnlyUpdatableFields(alarmToUpdate)))).thenReturn(alarmRep);
View Full Code Here


            .build();
    }

    private ManagedObjectRepresentation source() {
        ManagedObjectRepresentation source = new ManagedObjectRepresentation();
        source.setId(new GId("1"));
        return source;
    }
View Full Code Here

    public void shouldHoldStatusAndSource() {
        // given
        CumulocityAlarmStatuses status = CumulocityAlarmStatuses.ACKNOWLEDGED;

        // when
        AlarmFilter filter = alarmFilter.bySource(new GId("1")).byStatus(status);

        // then
        assertThat(filter.getSource(), is("1"));
        assertThat(filter.getStatus(), is(status.toString()));
    }
View Full Code Here

    @Test
    public void shouldGetMo() throws Exception {
        //Given
        String gidValue = "gid_value";
        GId gid = new GId(gidValue);

        //When
        ManagedObjectImpl mo = (ManagedObjectImpl) inventoryApiResource.getManagedObject(gid);

        // Then
View Full Code Here

    }

    @Test(expected = SDKException.class)
    public void shouldThrowExceptionWhenGetWithIncorrectGid() throws SDKException {
        // Given
        GId gid = new GId();

        // When
        inventoryApiResource.getManagedObject(gid);

        // Then
View Full Code Here

    }

    @Test
    public void testGetChildDevice() throws SDKException {
        //Given
        GId gid = new GId("deviceId");
        ManagedObjectReferenceRepresentation retrieved = new ManagedObjectReferenceRepresentation();
        when(restConnector.get(CHILD_DEVICES_URL + "/deviceId", MANAGED_OBJECT_REFERENCE,
                ManagedObjectReferenceRepresentation.class)).thenReturn(retrieved);

        // when
View Full Code Here

    }

    @Test
    public void testDeleteChildDevice() throws Exception {
        //Given
        GId gid = new GId("deviceId");

        // when
        managedObject.deleteChildDevice(gid);

        // then
View Full Code Here

    }

    @Test
    public void testGetChildAsset() throws Exception {
        //Given
        GId gid = new GId("assetId");
        ManagedObjectReferenceRepresentation retrieved = new ManagedObjectReferenceRepresentation();
        when(restConnector.get(CHILD_ASSETS_URL + "/assetId", MANAGED_OBJECT_REFERENCE,
                ManagedObjectReferenceRepresentation.class)).thenReturn(retrieved);

        // when
View Full Code Here

    }

    @Test
    public void testDeleteChildAsset() throws Exception {
        //Given
        GId gid = new GId("assetId");

        // when
        managedObject.deleteChildAsset(gid);

        // then
View Full Code Here

    }

    @Test
    public void shouldGetOperation() throws SDKException {
        // Given
        GId gid = new GId("value");
        OperationRepresentation op = new OperationRepresentation();
        when(restConnector.get(DEVICE_CONTROL_COLLECTION_URL + "/value", DeviceControlMediaType.OPERATION, OperationRepresentation.class))
                .thenReturn(op);

        // When
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.