Package com.cumulocity.rest.representation.event

Examples of com.cumulocity.rest.representation.event.EventRepresentation


    // ------------------------------------------------------------------------

    @Given("I have '(\\d+)' Events of type '([^']*)' for the managed object$")
    public void iHaveEvents(int n, String type) {
        for (int i = 0; i < n; i++) {
            EventRepresentation rep = new EventRepresentation();
            rep.setType(type);
            rep.setTime(new Date());
            rep.setText(" Event of Managed Object : " + i);
            rep.setSource(managedObject);
            input.add(rep);

        }
    }
View Full Code Here


    @Given("I have '(\\d+)' Events with type '([^']*)' for the managed object$")
    public void iHaveEventsWithFragments(int n, String type) throws ClassNotFoundException, InstantiationException,
            IllegalAccessException {
        for (int i = 0; i < n; i++) {
            EventRepresentation rep = new EventRepresentation();
            rep.setType(type);
            rep.setTime(new Date());
            rep.setText(" Event of Managed Object : " + i);
            rep.setSource(managedObject);
            input.add(rep);
        }
    }
View Full Code Here

        }
    }

    @Given("I have a Event with no type value for the managed object$")
    public void iHaveAEventWithNoType() {
        EventRepresentation rep = new EventRepresentation();
        rep.setTime(new Date());
        rep.setText(" Event of Managed Object : " + 0);
        rep.setSource(managedObject);
        input.add(rep);
    }
View Full Code Here

        input.add(rep);
    }

    @Given("I have a Event with no text value for the managed object$")
    public void iHaveAEventWithNoText() {
        EventRepresentation rep = new EventRepresentation();
        rep.setType("type");
        rep.setTime(new Date());
        rep.setSource(managedObject);
        input.add(rep);
    }
View Full Code Here

        input.add(rep);
    }

    @Given("I have a Event with no time value for the managed object$")
    public void iHaveAEventWithNoTime() {
        EventRepresentation rep = new EventRepresentation();
        rep.setType("type");
        rep.setText(" Event of Managed Object : " + 1);
        rep.setSource(managedObject);
        input.add(rep);
    }
View Full Code Here

    }

    @Given("I have '(\\d+)' Events for the source '(\\d+)' the managed object$")
    public void iHaveEventsForSource(int n, int index) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        for (int i = 0; i < n; i++) {
            EventRepresentation rep = new EventRepresentation();
            rep.setType("type");
            rep.setTime(new Date());
            rep.setText(" Event of Managed Object : " + i);
            rep.setSource(managedObject);
            input.add(rep);
        }
    }
View Full Code Here

    }

    @Given("I have a Event with time '([^']*)' with type '([^']*)' and for '(\\d+)' managed object$")
    public void iHaveAEventWithTypeAndTime(String time, String type, int index) throws ClassNotFoundException, InstantiationException,
            IllegalAccessException {
        EventRepresentation rep = new EventRepresentation();
        rep.setType(type);
        rep.setText(" Event of Managed Object : ");
        rep.setTime(DateConverter.string2Date(time));
        System.out.println("Time = "+ DateConverter.date2String(rep.getTime()));
        rep.setSource(managedObject);
        input.add(rep);
    }
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
        EventRepresentation event = eventApi.getEvent(gid);

        // Then
        assertThat(event, sameInstance(retrieved));
    }
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);

        // Then
View Full Code Here

    }

    @Test
    public void testCreateEventInCollection() throws SDKException {
        // Given
        EventRepresentation eventRepresentation = new EventRepresentation();
        EventRepresentation created = new EventRepresentation();
        when(restConnector.post(EVENTS_COLLECTION_URL, EventMediaType.EVENT, eventRepresentation)).thenReturn(created);

        // When
        EventRepresentation result = eventApi.create(eventRepresentation);

        // Then
        assertThat(result, sameInstance(created));

    }
View Full Code Here

TOP

Related Classes of com.cumulocity.rest.representation.event.EventRepresentation

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.