Package org.mule.example.loanbroker.model

Examples of org.mule.example.loanbroker.model.LoanQuote


        this.endpoint = ((ImmutableEndpoint) endpoints.get(0)).getName();
    }

    public LoanQuote getLoanQuote(LoanBrokerQuoteRequest request)
    {
        LoanQuote quote = new LoanQuote();
        quote.setBankName(getBankName());
        quote.setInterestRate(primeRate);
        logger.info("Returning Rate is: " + quote);

        return quote;
    }
View Full Code Here


        MuleMessage result = client.send("http://localhost:11080?responseTransformers=streamToObjectTransformer", request, null);
        assertNotNull("Result is null", result);
        assertFalse("Result is null", result.getPayload() instanceof NullPayload);
        assertTrue("Result should be LoanQuote but is " + result.getPayload().getClass().getName(),
                    result.getPayload(Object.class) instanceof LoanQuote);
        LoanQuote quote = (LoanQuote)result.getPayload();
        assertTrue(quote.getInterestRate() > 0);
    }
View Full Code Here

    public MuleEvent process(MuleEvent event) throws TransformerException
    {

        Object payload = event.getMessage().getPayload();
        LoanQuote lowestQuote = null;

        if (payload instanceof LoanQuote)
        {
            lowestQuote = (LoanQuote) payload;
        }
        else
        {
            @SuppressWarnings("unchecked")
            List<LoanQuote> loanQuotes = (List<LoanQuote>) payload;
            for (LoanQuote loanQuote : loanQuotes)
            {

                if (lowestQuote == null)
                {
                    lowestQuote = loanQuote;
                }
                else
                {
                    if (loanQuote.getInterestRate() < lowestQuote.getInterestRate())
                    {
                        lowestQuote = loanQuote;
                    }
                }
            }
View Full Code Here

        Arrays.sort(rates);
    }

    public LoanQuote getLoanQuote(LoanBrokerQuoteRequest request)
    {
        LoanQuote quote = new LoanQuote();
        quote.setBankName(getBankName());
        int creditScore = request.getCreditProfile().getCreditScore();
        quote.setInterestRate(getCreditScoreRate(creditScore));
        logger.info("Returning Rate is: " + quote);

        return quote;
    }
View Full Code Here

TOP

Related Classes of org.mule.example.loanbroker.model.LoanQuote

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.