Package org.switchyard.quickstarts.demo.txpropagation

Examples of org.switchyard.quickstarts.demo.txpropagation.Offer


    @Test
    public void creditApproved() throws Exception {
        Application app = new Application();
        app.setName("phil garfield");
        app.setCreditScore(600);
        Offer offer = new Offer();
        offer.setApplication(app);

        Application result = service.operation("checkCredit").sendInOut(offer).getContent(Application.class);

        // validate the results
        Assert.assertTrue(result.isApproved());
View Full Code Here


    @Test
    public void creditDenied() throws Exception {
        Application app = new Application();
        app.setName("bill whatwhatwhat");
        app.setCreditScore(400);
        Offer offer = new Offer();
        offer.setApplication(app);

        Application result = service.operation("checkCredit").sendInOut(offer).getContent(Application.class);

        // validate the results
        Assert.assertFalse(result.isApproved());
View Full Code Here

    @Test
    public void rejectLowBallOffer() throws Exception {
        Car car = new Car();
        car.setPrice(500.00);
        Offer offer = new Offer();
        offer.setCar(car);
        offer.setAmount(100.00);

        Deal deal = service.operation("offer").sendInOut(offer).getContent(Deal.class);

        // verify the deal is rejected
        Assert.assertFalse(deal.isAccepted());
View Full Code Here

    public void acceptValidOffer() throws Exception {
        Car car = new Car();
        car.setPrice(500.00);
        Application app = new Application();
        app.setCreditScore(650);
        Offer offer = new Offer();
        offer.setCar(car);
        offer.setApplication(app);
        offer.setAmount(450.00);

        // configure our proxy for the service reference
        testKit.replaceService("DealLogger");
        MockHandler creditService = testKit.replaceService("CreditCheckService");
        Application reply = new Application();
View Full Code Here

    public static void main(final String[] args) throws Exception {
        // Create a new remote client invoker
        RemoteInvoker invoker = new HttpInvoker(URL);

        // Create request payload
        Offer offer = null;
        if (args.length == 1 && args[0].equals("deny")) {
            offer = createOffer(false);
        } else {
            offer = createOffer(true);
        }
View Full Code Here

        app.setName("John Smith");
        app.setCreditScore(acceptable ? 700 : 300);
        Car car = new Car();
        car.setPrice(18000);
        car.setVehicleId("Honda");
        Offer offer = new Offer();
        offer.setApplication(app);
        offer.setCar(car);
        offer.setAmount(17000);

        return offer;
    }
View Full Code Here

TOP

Related Classes of org.switchyard.quickstarts.demo.txpropagation.Offer

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.