
package com.example.helloworld.resources;

import java.util.HashMap;
import java.util.Map;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

@Path("/json")
@Produces(MediaType.APPLICATION_JSON)
public class JsonResource
{
  private final Map<String, String> MESSAGE = new HashMap<String, String>();

  public JsonResource()
  {
    MESSAGE.put("message", "Hello, world!");
  }

  @GET
  public Map<String, String> sayHello()
  {
    return MESSAGE;
  }
}

@@ -287,158 +287,221 @@
 %7B%0A  
-private final Map%3CString, String%3E MESSAGE = new HashMap%3CString, String%3E();%0A%0A  public JsonResource()%0A  %7B%0A    MESSAGE.put(%22message%22, %22Hello, world!%22);%0A 
+// Response message class (copied from 'servlet' test)%0A  public final static class HelloMessage %7B%0A    public final String message;%0A%0A    public HelloMessage(String m) %7B message = m; %7D%0A  %7D%0A%0A  public JsonResource() %7B
  %7D%0A%0A
@@ -520,27 +520,20 @@
 lic 
-Map%3CString, String%3E
+HelloMessage
  say
@@ -559,15 +559,41 @@
 urn 
-MESSAGE
+new HelloMessage(%22Hello, World!%22)
 ;%0A  

Improve DropWizard test to use JSON generation similar to Servlet test -- more efficient that way