Package com.streamreduce.rest.dto.response

Examples of com.streamreduce.rest.dto.response.SobaMessageResponseDTO


    @Test
    @Ignore
    public void testGetPrivateMessageById() throws Exception {
        // get one random message
        SobaMessage privateMessage = applicationManager.getMessageService().getAllMessages(getTestUser(), null, null, 1, true, null, null, null, false).get(0);
        SobaMessageResponseDTO responseDTO = jsonToObject(makeRequest(getUrl() + "/" + privateMessage.getId(), "GET",
                null, authToken),
                TypeFactory.defaultInstance().constructType(SobaMessageResponseDTO.class));

        assertNotNull(responseDTO);
        assertEquals(privateMessage.getId(), responseDTO.getMessageId());
    }
View Full Code Here


                userMessage.getMessageId());

        assertEquals(num + 1, sobaMessage.getHashtags().size());

        String response = makeRequest(getUrl() + "/" + userMessage.getMessageId(), "GET", json, authToken);
        SobaMessageResponseDTO sobaMessageResponseDTO = jsonToObject(response,
                TypeFactory.defaultInstance().constructType(SobaMessageResponseDTO.class));

        assertEquals(num + 1, sobaMessageResponseDTO.getHashtags().size());

    }
View Full Code Here

                    outboundClientFactory.createOutboundClientForOutboundConfiguration(outboundConfiguration);

            if (dto.getDataType() == OutboundDataType.RAW) {
                outboundClient.putRawMessage(JSONObject.fromObject(dto.getPayload()));
            } else if (dto.getDataType() == OutboundDataType.PROCESSED) {
                SobaMessageResponseDTO responseDTO =
                        objectMapper.readValue(dto.getPayload(), SobaMessageResponseDTO.class);
                outboundClient.putProcessedMessage(responseDTO);
            } else if (dto.getDataType() == OutboundDataType.INSIGHT) {
                SobaMessageResponseDTO responseDTO =
                        objectMapper.readValue(dto.getPayload(), SobaMessageResponseDTO.class);
                outboundClient.putInsightMessage(responseDTO);
            } else {
                throw new OutboundStorageException("The received OutboundConfigurationWithPayloadDTO does not " +
                        "specify a valid dataType.  Was " + dto.getDataType() +
View Full Code Here

        SobaMessage sobaMessage = new SobaMessage.Builder()
                .type(MessageType.INVENTORY_ITEM)
                .visibility(SobaObject.Visibility.ACCOUNT)
                .sender(sender)
                .build();
        SobaMessageResponseDTO responseDTO = SobaMessageResponseDTO.fromSobaMessage(sobaMessage);
        Assert.assertEquals(sender.getAccount().getId(),responseDTO.getSenderAccountId());
    }
View Full Code Here

        JSONObject json = new JSONObject();

        json.put("message", "This is a bootstrapped message to self and the stream");

        // not such a good idea.
        SobaMessageResponseDTO message = jsonToObject(makeRequest(getUrl(), "POST", json, authToken),
                TypeFactory.defaultInstance().constructType(SobaMessageResponseDTO.class));

        userMessage = message;
    }
View Full Code Here

    public void testAddMessage() throws Exception {
        JSONObject json = new JSONObject();

        json.put("message", "This is a message with no @");

        SobaMessageResponseDTO message = jsonToObject(makeRequest(getUrl(), "POST", json, authToken),
                TypeFactory.defaultInstance().constructType(SobaMessageResponseDTO.class));

        assertNotNull(message);
        assertEquals(getTestUser().getId(), message.getSenderId());
        //
    }
View Full Code Here

    public void testAddMessageToAnotherUser() throws Exception {
        JSONObject json = new JSONObject();

        json.put("message", "This is a message to @" + localUser1.getAlias());

        SobaMessageResponseDTO message = jsonToObject(makeRequest(getUrl(), "POST", json, authToken),
                TypeFactory.defaultInstance().constructType(SobaMessageResponseDTO.class));

        assertNotNull(message);
        assertEquals(getTestUser().getId(), message.getSenderId());
        //
    }
View Full Code Here

    public void testDeleteMessageToAnotherUser() throws Exception {
        JSONObject json = new JSONObject();

        json.put("message", "This is a message to @" + localUser1.getAlias());

        SobaMessageResponseDTO message = jsonToObject(makeRequest(getUrl(), "POST", json, authToken),
                TypeFactory.defaultInstance().constructType(SobaMessageResponseDTO.class));

        assertNotNull(message);
        assertEquals(getTestUser().getId(), message.getSenderId());
        //
        // mock remove it
        makeRequest(getUrl() + "/" + message.getId(), "DELETE", json, authToken);

        SobaMessageResponseDTO responseDTO = jsonToObject(makeRequest(getUrl() + "/" + message.getId(), "GET",
                null, authToken),
                TypeFactory.defaultInstance().constructType(SobaMessageResponseDTO.class));

        assertEquals(responseDTO.getPayload(), "message removed by @" + testUser.getAlias());

    }
View Full Code Here

TOP

Related Classes of com.streamreduce.rest.dto.response.SobaMessageResponseDTO

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.