Examples of GId


Examples of com.cumulocity.me.model.idtype.GId

    }

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

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

        // When
View Full Code Here

Examples of com.cumulocity.me.model.idtype.GId

    }

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

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

        // When
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

    @Test
    public void shouldHoldTypeSourceDateAndFragmentType() throws Exception {
        Date fromDate = new Date(0L);
        Date toDate = new Date(1L);
        MeasurementFilter filter = new MeasurementFilter().byType("type").bySource(new GId("1")).byFragmentType(NonRelevantFragmentType.class).byDate(
                fromDate, toDate);

        assertThat(filter.getType(), is("type"));
        assertThat(filter.getSource(), is("1"));
        assertThat(filter.getFragmentType(), is(ExtensibilityConverter.classToStringRepresentation(NonRelevantFragmentType.class)));
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

    }

    @Test
    public void shouldGetAuditRecord() throws SDKException {
        // Given
        GId gid = new GId("123");
        AuditRecordRepresentation auditRep = new AuditRecordRepresentation();
        when(restConnector.get(AUDIT_RECORDS_URL + "/123", AuditMediaType.AUDIT_RECORD, AuditRecordRepresentation.class)).thenReturn(
                auditRep);

        // When
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

   
    @Before
    public void setUp() {
        testObj = new OperationsQueue();
        OperationRepresentation op1 = new OperationRepresentation();
        op1.setId(new GId("op1"));
        OperationRepresentation op2 = new OperationRepresentation();
        op2.setId(new GId("op2"));
        testObj.add(op1);
        testObj.add(op2);
    }
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

    }
   
    @Test
    public void testAddUnique() {
        OperationRepresentation op3 = new OperationRepresentation();
        op3.setId(new GId("op3"));
        assertTrue(testObj.add(op3));
        assertThat(testObj.size(), equalTo(3));
    }
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

    }

    @Test
    public void testAddNonUnique() {
        OperationRepresentation opNonUnique = new OperationRepresentation();
        opNonUnique.setId(new GId("op2"));
        assertFalse(testObj.add(opNonUnique));
        assertThat(testObj.size(), equalTo(2));
    }
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

    }
   
    @Test
    public void testAddNonUniqueList() {
        OperationRepresentation opNonUnique1 = new OperationRepresentation();
        opNonUnique1.setId(new GId("op1"));
        OperationRepresentation opNonUnique2 = new OperationRepresentation();
        opNonUnique2.setId(new GId("op2"));
        List<OperationRepresentation> list = new LinkedList<OperationRepresentation>();
        list.add(opNonUnique1);
        list.add(opNonUnique2);
       
        assertFalse(testObj.addAll(list));
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

    }
   
    @Test
    public void testAddUniqueList() {
        OperationRepresentation opUnique1 = new OperationRepresentation();
        opUnique1.setId(new GId("op3"));
        OperationRepresentation opUnique2 = new OperationRepresentation();
        opUnique2.setId(new GId("op4"));
        List<OperationRepresentation> list = new LinkedList<OperationRepresentation>();
        list.add(opUnique1);
        list.add(opUnique2);
       
        assertTrue(testObj.addAll(list));
View Full Code Here

Examples of com.cumulocity.model.idtype.GId

    }
   
    @Test
    public void testAddMixedList() {
        OperationRepresentation opUnique1 = new OperationRepresentation();
        opUnique1.setId(new GId("op3"));
        OperationRepresentation opNonUnique2 = new OperationRepresentation();
        opNonUnique2.setId(new GId("op1"));
        List<OperationRepresentation> list = new LinkedList<OperationRepresentation>();
        list.add(opUnique1);
        list.add(opNonUnique2);
       
        assertTrue(testObj.addAll(list)); //queue was changed, even if not all elements were added
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.