package com.ticketmanor.rest.client;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;

//import org.glassfish.jersey.jackson.JacksonFeature;

import com.ticketmanor.model.Event;

/** This will become an example of the JAX-RS 2.0 Client API.
 * It has a dependency on Jersey (which is in our POM file now).
 * It is confused by some fields in the returned JSON data...
 * @author Ian Darwin
 */
public class JaxRsClientMain {

	private static final String URL = 
		"http://localhost:8080/ticketmanor/rest/events/-1";

	public static void main(String[] args) {
		Client cl = ClientBuilder.newClient();
		//cl.register(JacksonFeature.class);
		WebTarget target = cl.target(URL);
		Event e = target.request(MediaType.APPLICATION_JSON).get(Event.class);
		System.out.println("Got an event: " + e);
	}
}

@@ -651,16 +651,65 @@
 args) %7B%0A
+%09%09process();%0A%09%7D%0A%09public static Event process() %7B%0A
 %09%09Client
@@ -934,13 +934,239 @@
 %22 + e);%0A
+%09%09return e;%0A%09%7D%0A%09%0A%09public static Event process2() %7B%0A%09%09Event e = ClientBuilder.newClient()%0A%09%09%09%09.target(URL)%0A%09%09%09%09.request(MediaType.APPLICATION_JSON)%0A%09%09%09%09.get(Event.class);%0A%09%09System.out.println(%22Got an event: %22 + e);%0A%09%09return e;%0A
 %09%7D%0A%7D%0A

Split out main into process(), and add shortened version in process2().