test_class.declarator: manager = mock(ClusterDiskSpaceManager.class)
test_class.modifier: private final
test_class.original_string: private final ClusterDiskSpaceManager manager = mock(ClusterDiskSpaceManager.class);
test_class.type: ClusterDiskSpaceManager
test_class.var_name: manager
test_class.declarator: resource
test_class.modifier: private
test_class.original_string: private SetSpaceResource resource;
test_class.type: SetSpaceResource
test_class.var_name: resource
test_class.file: harahachibu/src/test/java/uk/co/flax/harahachibu/resources/SetSpaceResourceTest.java
test_class.identifier: SetSpaceResourceTest
test_case.body: @Test
  	public void returnsErrorOnException() throws Exception {
  		final String server = "dummy";
  		doThrow(new DiskSpaceCheckerException("Error")).when(manager).setDiskSpace(eq(server), isA(DiskSpace.class));
  
  		SetSpaceResponse response = resource.handlePost(server, 128L, 1024L);
  		assertThat(response).isNotNull();
  		assertThat(response.getResponseCode()).isEqualTo(SetSpaceResponse.ResponseCode.ERROR);
  		assertThat(response.getMessage()).isEqualTo("Error");
  
  		verify(manager).setDiskSpace(eq(server), isA(DiskSpace.class));
  	}
test_case.class_method_signature: SetSpaceResourceTest.returnsErrorOnException()
test_case.full_signature: @Test public void returnsErrorOnException()
test_case.identifier: returnsErrorOnException
test_case.invocations: setDiskSpace when doThrow eq isA handlePost isNotNull assertThat isEqualTo assertThat getResponseCode isEqualTo assertThat getMessage setDiskSpace verify eq isA
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void returnsErrorOnException()
focal_class.declarator: clusterManager
focal_class.modifier: private final
focal_class.original_string: private final ClusterDiskSpaceManager clusterManager;
focal_class.type: ClusterDiskSpaceManager
focal_class.var_name: clusterManager
focal_class.file: harahachibu/src/main/java/uk/co/flax/harahachibu/resources/SetSpaceResource.java
focal_class.identifier: SetSpaceResource
focal_class.class_method_signature: SetSpaceResource.SetSpaceResource(ClusterDiskSpaceManager clusterManager)
focal_class.full_signature: public  SetSpaceResource(ClusterDiskSpaceManager clusterManager)
focal_class.identifier: SetSpaceResource
focal_class.modifiers: public
focal_class.parameters: (ClusterDiskSpaceManager clusterManager)
focal_class.signature:  SetSpaceResource(ClusterDiskSpaceManager clusterManager)
focal_class.class_method_signature: SetSpaceResource.handlePost(@PathParam("host") String server,
  									   @PathParam("freeSpace") long freeSpace,
  									   @PathParam("maxSpace") long maxSpace)
focal_class.full_signature: @POST @Produces(MediaType.APPLICATION_JSON) public SetSpaceResponse handlePost(@PathParam("host") String server,
  									   @PathParam("freeSpace") long freeSpace,
  									   @PathParam("maxSpace") long maxSpace)
focal_class.identifier: handlePost
focal_class.modifiers: @POST @Produces(MediaType.APPLICATION_JSON) public
focal_class.parameters: (@PathParam("host") String server,
  									   @PathParam("freeSpace") long freeSpace,
  									   @PathParam("maxSpace") long maxSpace)
focal_class.return: SetSpaceResponse
focal_class.signature: SetSpaceResponse handlePost(@PathParam("host") String server,
  									   @PathParam("freeSpace") long freeSpace,
  									   @PathParam("maxSpace") long maxSpace)
focal_method.body: @POST
  	@Produces(MediaType.APPLICATION_JSON)
  	public SetSpaceResponse handlePost(@PathParam("host") String server,
  									   @PathParam("freeSpace") long freeSpace,
  									   @PathParam("maxSpace") long maxSpace) {
  		SetSpaceResponse response;
  
  		try {
  			clusterManager.setDiskSpace(server, new DiskSpace(freeSpace, maxSpace));
  			response = SetSpaceResponse.okResponse();
  		} catch (DiskSpaceCheckerException e) {
  			response = new SetSpaceResponse(SetSpaceResponse.ResponseCode.ERROR, e.getMessage());
  		}
  
  		return response;
  	}
focal_method.class_method_signature: SetSpaceResource.handlePost(@PathParam("host") String server,
  									   @PathParam("freeSpace") long freeSpace,
  									   @PathParam("maxSpace") long maxSpace)
focal_method.full_signature: @POST @Produces(MediaType.APPLICATION_JSON) public SetSpaceResponse handlePost(@PathParam("host") String server,
  									   @PathParam("freeSpace") long freeSpace,
  									   @PathParam("maxSpace") long maxSpace)
focal_method.identifier: handlePost
focal_method.invocations: setDiskSpace okResponse getMessage
focal_method.modifiers: @POST @Produces(MediaType.APPLICATION_JSON) public
focal_method.parameters: (@PathParam("host") String server,
  									   @PathParam("freeSpace") long freeSpace,
  									   @PathParam("maxSpace") long maxSpace)
focal_method.return: SetSpaceResponse
focal_method.signature: SetSpaceResponse handlePost(@PathParam("host") String server,
  									   @PathParam("freeSpace") long freeSpace,
  									   @PathParam("maxSpace") long maxSpace)