Package com.cumulocity.model.idtype

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


    }

    @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

   
    @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

    }
   
    @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

    }

    @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

    }
   
    @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

    }
   
    @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

    }
   
    @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

    }

    @Test
    public void testOperationProcessingSuccessful() throws Exception {
        //GIVEN
        GId id = new GId("op");

        OperationRepresentation op = new OperationRepresentation();
        op.setId(id);
        queue.add(op);
        when(operationProcessor.process(op)).thenReturn(true);
View Full Code Here

    }

    @Test
    public void testOperationProcessingFailed() throws Exception {
        //GIVEN
        GId id = new GId("op");
        OperationRepresentation op = new OperationRepresentation();
        op.setId(id);
        queue.add(op);
        when(operationProcessor.process(op)).thenReturn(false);
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.