Package com.streamreduce.core.model

Examples of com.streamreduce.core.model.Account$Builder


            // Validate the generated metadata based on object type

            Map<String, Object> expectedObjectMetadata = new HashMap<>();

            if (expectedTarget instanceof Account) {
                Account tAccount = (Account) expectedTarget;

                expectedObjectMetadata.put("targetFuid", tAccount.getFuid());
                expectedObjectMetadata.put("targetName", tAccount.getName());
            } else if (expectedTarget instanceof InventoryItem) {
                InventoryItem tInventoryItem = (InventoryItem) expectedTarget;
                Connection tConnection = tInventoryItem.getConnection();
                ConnectionProvider tConnectionProvider =
                        applicationManager.getConnectionProviderFactory()
View Full Code Here


        accountDAO.save(testAccount);
    }

    @Test
    public void testFindByName() {
        Account returnedAccount = accountDAO.findByName("AccountDAOTest-testAccount");
        assertEquals(returnedAccount,testAccount);
    }
View Full Code Here

        try {
            testUser = userService.getUser(testUsername);
            testAccount = testUser.getAccount();
        } catch (UserNotFoundException e) {
            Account account = new Account.Builder()
                    .url("http://nodeable.com")
                    .description("Nodeable Test Account")
                    .name("Nodeable Test")
                    .build();
            testAccount = userService.createAccount(account);
View Full Code Here

    }

    @Test
    public void testConvertOutboundConnectionToBucketName_UsesAccountId() throws Exception {
        ObjectId accountId = new ObjectId();
        Account acct = new Account.Builder().name("testacct").build();
        acct.setId(accountId);
        Connection mockConnection = mock(Connection.class);
        when(mockConnection.getAccount()).thenReturn(acct);

        OutboundConfiguration mockOutboundConfiguration = mock(OutboundConfiguration.class);
        when(mockOutboundConfiguration.getNamespace()).thenReturn(null);
View Full Code Here

    public static final String SAMPLE_FEED_FILE_PATH = TestUtils.class.getResource(
            "/com/streamreduce/rss/sample_EC2.rss").toString();


    public static User createTestUser() {
        Account account = new Account.Builder().name("tool").build();
        account.setId(new ObjectId());

        User user = new User.Builder()
                .username("maynard@toolband.com")
                .account(account)
                .password("trollolol")
View Full Code Here

        assertEquals(sender.getAccount().getId(), sobaMessage.getSenderAccountId());

    }

    private Connection createValidSender() {
        Account account = new Account.Builder().name("ho").build();
        account.setId(new ObjectId());

        User user = new User.Builder().username("hey").account(account).build();
        user.setId(new ObjectId());

        Connection connection = new Connection.Builder()
View Full Code Here

    }

    @Test
    public void testListAllConnections() throws Exception {

        Account nAccount = testUser.getAccount();
        List<Connection> nConnections = connectionService.getConnections(null, testUser);

        for (Connection connection : nConnections) {
            Assert.assertTrue(connection.getAccount().getId().equals(nAccount.getId()));
        }
    }
View Full Code Here

        when(searchService.searchMessages(any(Account.class), anyString(), anyMap(), any(JSONObject.class))).thenCallRealMethod();
        //Make call to makeRequest so that it returns the elasticSearchPayload
        when(searchService.makeRequest(anyString(),any(JSONObject.class),anyMap(),anyString())).thenReturn(elasticSearchPayload);


        Account a = new Account.Builder().name("testAccount").build();
        a.setId(new ObjectId());

        List<SobaMessage> sobaMessages = searchService.searchMessages(a,"resource", null,null);

        //Expected number of hits in json:
        int expectedSize = elasticSearchPayload.getJSONObject("hits").getJSONArray("hits").size();
View Full Code Here

        searchService.createRiverForAccount(null);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testCreateRiverForAccountWithoutId() {
        Account acctWithoutId = new Account.Builder()
                .name("foo")
                .build();
        acctWithoutId.setId(null);

        SearchService searchService = new SearchServiceImpl();
        ReflectionTestUtils.setField(searchService,"enabled",true);
        searchService.createRiverForAccount(acctWithoutId);
    }
View Full Code Here

        connection = applicationManager.getConnectionService().getConnection(connection.getId());
        assertNotNull(connection);

        // make sure you account object has it in the blacklisted list
        //boolean exists =
        Account account = applicationManager.getUserService().getAccount(testUser.getAccount().getId());
        assertFalse(!account.getPublicConnectionBlacklist().contains(connection.getId()));

        // should not show up in your connection list now.
        String req = makeRequest(connectionsBaseUrl, "GET", null, authnToken);

        List<ConnectionResponseDTO> allConnections = jsonToObject(req,
View Full Code Here

TOP

Related Classes of com.streamreduce.core.model.Account$Builder

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.