diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-06-26 00:02:37 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-06-26 00:02:37 +0000 |
commit | 91e796407efd625e37853545415ddcd44acb0fdc (patch) | |
tree | f97c3a59854a10ca7391b4cf7a42c4423516c910 /sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/customer/CustomerServiceImpl.java | |
parent | 512a3d697d367b57d00e40ce26ad9d7d24cef996 (diff) |
Use Response as the type
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@958151 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/customer/CustomerServiceImpl.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/customer/CustomerServiceImpl.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/customer/CustomerServiceImpl.java index 70c718a656..22e63e0f91 100644 --- a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/customer/CustomerServiceImpl.java +++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/customer/CustomerServiceImpl.java @@ -19,9 +19,12 @@ package services.customer; +import java.net.URI; import java.util.HashMap; import java.util.Map; +import javax.ws.rs.core.Response; + import org.oasisopen.sca.annotation.Init; import org.oasisopen.sca.annotation.Scope; @@ -38,8 +41,13 @@ public class CustomerServiceImpl implements CustomerService { return customers.values().iterator().next(); } - public void addCustomer(Customer customer) { + public Response getResponse() { + return Response.ok(get()).build(); + } + + public Response addCustomer(Customer customer) { customers.put(customer.getName(), customer); + return Response.created(URI.create("/001")).build(); } public void updateCustomer(Customer customer) { |