jclouds/jclouds-labs-aws — pull request #17 by rcoedo (2014-06-18 13:53:49+00:00)
Title: JCLOUDS-457: Clean up for GlacierClientMockTest.

GlacierClientMockTest was growing uncontrollably. This commit
is an attempt to fix this problem.

- The first measure taken moves the duplicated strings to constants
and the JSON response bodies to resource files. In addition, some
repeated code was moved to static classes, where they can be reused.

- The second measure taken to address this problem takes advantage
of Guice's AOP features:

A MockTestInterceptor has been made. this interceptor intercepts
test methods annotated with @MockTest and opens a MockWebServer
for them. The interceptor also initializes a GlacierClient
pointing to the server URL. When the method ends, the server
shuts down.

To configure the module, we make use of the @Guice annotation
supported by testng.