Java Reference
In-Depth Information
We enable this interceptor for all requests that return an entity by registering it within our
Application
class. I won't go over this code, as you should be familiar with how to do this
by now.
The Client Code
The client code is basically the same as
ex12_1
except we are viewing the returned
Content-
MD5
header:
src/test/java/com/restfully/shop/test/CustomerResourceTest.java
@Test
public
public
void
void
testCustomerResource
()
throws
throws
Exception
{
...
System
.
out
.
println
(
"*** GET Created Customer **"
);
response
=
client
.
target
(
location
).
request
().
get
();
String md5
=
response
.
getHeaderString
(
"Content-MD5"
);
System
.
out
.
println
(
"Content-MD5: "
+
md5
);
}
Build and Run the Example Program
Perform the following steps:
1. Open a command prompt or shell terminal and change to the
ex12_2
directory of the
workbook example code.
2. Make sure your PATH is set up to include both the JDK and Maven, as described in
3. Perform the build and run the example by typing
maven install
.