Examples of GId


Examples of com.cumulocity.model.idtype.GId

    }

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

        // when
        managedObject.deleteChildAsset(gid);

        // then
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

    }

    @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

Examples of com.cumulocity.model.idtype.GId

    @Test
    public void shouldUpdateOperation() throws SDKException {
        //Given
        OperationRepresentation op = new OperationRepresentation();
        op.setStatus(OperationStatus.EXECUTING.toString());
        op.setId(new GId("myId"));
        op.setCreationTime(new Date());
        OperationRepresentation updated = new OperationRepresentation();
        when(restConnector.put(eq(DEVICE_CONTROL_COLLECTION_URL + "/myId"), eq(DeviceControlMediaType.OPERATION),
                argThat(hasOnlyUpdateFields(op)))).thenReturn(updated);
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

    public GId parseIdFromLocation(ClientResponse response) {
        String path;
        path = response.getLocation().getPath();
        String[] pathParts = path.split("\\/");
        String gid = pathParts[pathParts.length - 1];
        return new GId(gid);
    }
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

    public void iHaveManagedObject(long globalId, String extId, String type) {
        ExternalIDRepresentation rep = new ExternalIDRepresentation();
        rep.setExternalId(extId);
        rep.setType(type);
        ManagedObjectRepresentation mo = new ManagedObjectRepresentation();
        GId gId = new GId();
        gId.setValue(Long.toString(globalId));
        mo.setId(gId);
        rep.setManagedObject(mo);
        input.add(rep);
    }
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

        // When
        Coordinate coordinate = new Coordinate(100.0, 10.0);
        result.set(coordinate);

        GId id = result.getId();
        result.setId(null);
        result.setLastUpdated(null);

        ManagedObjectRepresentation updated = inventory.getManagedObject(id).update(result);
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

        ManagedObjectRepresentation rep = aSampleMo().with(new Coordinate()).build();
        ManagedObjectRepresentation created = inventory.create(rep);

        // When
        created.set(null, Coordinate.class);
        GId id = created.getId();
        created.setId(null);
        created.setLastUpdated(null);
        ManagedObjectRepresentation updated = inventory.getManagedObject(id).update(created);

        // Then
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

    }

    @Test
    public void tryToGetNonExistentManagedObject() throws Exception {
        // Given
        ManagedObjectRepresentation rep = aSampleMo().withID(new GId("1")).build();

        // Then
        exception.expect(sdkException(NOT_FOUND));

        // When
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

    }

    @Test
    public void tryToDeleteNonExistentManagedObject() throws Exception {
        // Given
        ManagedObjectRepresentation rep = aSampleMo().withID(new GId("1")).build();

        // Then
        exception.expect(sdkException(NOT_FOUND));

        // When
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

        // Then
        exception.expect(sdkException(NOT_FOUND));

        // When
        inventory.getManagedObject(new GId("1")).update(rep);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.