Package com.bazaarvoice.auth.hmac.sample.client

Source Code of com.bazaarvoice.auth.hmac.sample.client.PizzaClientTest

package com.bazaarvoice.auth.hmac.sample.client;

import com.bazaarvoice.auth.hmac.sample.Pizza;
import com.google.common.base.Joiner;

import java.net.URI;

public class PizzaClientTest {
    // This is the default endpoint for the Pizza service when you run it
    private static final URI ENDPOINT = URI.create("http://localhost:8080");

    // These keys are defined in PizzaAuthenticator
    private static final String API_KEY = "fred-api-key";
    private static final String SECRET_KEY = "fred-secret-key";

    public static void main(String[] args) throws Exception {
        // Get a pizza
        PizzaClient pizzaClient = new PizzaClient(ENDPOINT, API_KEY, SECRET_KEY);
        Pizza pizza = pizzaClient.getPizza();

        // Print out the results
        System.out.printf("Pizza is size '%s' with toppings: %s%n",
                pizza.getSize(),
                Joiner.on(", ").join(pizza.getToppings()));
    }
}
TOP

Related Classes of com.bazaarvoice.auth.hmac.sample.client.PizzaClientTest

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.