Examples of EventRepresentation


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

    }

    @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

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

    @When("I create all Events$")
    public void iCreateAll() throws SDKException {
        try {
            Iterator iterator = input.iterator();
            while (iterator.hasNext()) {
                EventRepresentation resultt = eventApi.create((EventRepresentation) iterator.next());
                result.add(resultt);
            }
        } catch (SDKException ex) {
            status = ex.getHttpStatus();
        }
View Full Code Here

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

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

    @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

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

        }
    }

    @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

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

        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

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

        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

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

    }

    @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

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

    }

    @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

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

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