@Test public void errorShapeMetadata_baseExceptionGiven_usesBaseException() { JsonClientMetadata metadata = mock(JsonClientMetadata.class); when(metadata.getBaseServiceExceptionClass()).thenReturn((Class) RuntimeException.class); when(metadata.getErrorShapeMetadata()).thenReturn(Collections.<JsonErrorShapeMetadata>emptyList()); new SdkJsonProtocolFactory(metadata).createErrorResponseHandler(new JsonErrorResponseMetadata()); verify(metadata, atLeastOnce()).getBaseServiceExceptionClass(); }
public HttpResponseHandler<AmazonServiceException> createErrorResponseHandler( JsonErrorResponseMetadata errorResponsMetadata) { return getSdkFactory().createErrorResponseHandler(errorUnmarshallers, errorResponsMetadata .getCustomErrorCodeFieldName()); }
SdkJsonProtocolFactory implements SdkJsonMarshallerFactory { public HttpResponseHandler<AmazonServiceException> createErrorResponseHandler( JsonErrorResponseMetadata errorResponsMetadata) { return getSdkFactory().createErrorResponseHandler(errorUnmarshallers, errorResponsMetadata .getCustomErrorCodeFieldName()); } }
SdkJsonProtocolFactory implements SdkJsonMarshallerFactory { public HttpResponseHandler<AmazonServiceException> createErrorResponseHandler( JsonErrorResponseMetadata errorResponsMetadata) { return getSdkFactory().createErrorResponseHandler(errorUnmarshallers, errorResponsMetadata .getCustomErrorCodeFieldName()); } SdkJsonProtocolFactory(JsonClientMetadata metadata); }
SdkJsonProtocolFactory implements SdkJsonMarshallerFactory { public HttpResponseHandler<AmazonServiceException> createErrorResponseHandler( JsonErrorResponseMetadata errorResponsMetadata) { return getSdkFactory().createErrorResponseHandler(errorUnmarshallers, errorResponsMetadata .getCustomErrorCodeFieldName()); } SdkJsonProtocolFactory(JsonClientMetadata metadata); @Override StructuredJsonGenerator createGenerator(); @Override String getContentType(); ProtocolRequestMarshaller<T> createProtocolMarshaller(OperationInfo operationInfo, T origRequest); HttpResponseHandler<AmazonWebServiceResponse<T>> createResponseHandler(
            JsonOperationMetadata operationMetadata,
            Unmarshaller<T, JsonUnmarshallerContext> responseUnmarshaller); HttpResponseHandler<AmazonServiceException> createErrorResponseHandler(
            JsonErrorResponseMetadata errorResponsMetadata); }
SdkJsonProtocolFactory implements SdkJsonMarshallerFactory { public HttpResponseHandler<AmazonServiceException> createErrorResponseHandler( JsonErrorResponseMetadata errorResponsMetadata) { return getSdkFactory().createErrorResponseHandler(errorUnmarshallers, errorResponsMetadata .getCustomErrorCodeFieldName()); } SdkJsonProtocolFactory(JsonClientMetadata metadata); @Override StructuredJsonGenerator createGenerator(); @Override String getContentType(); ProtocolRequestMarshaller<T> createProtocolMarshaller(OperationInfo operationInfo, T origRequest); HttpResponseHandler<AmazonWebServiceResponse<T>> createResponseHandler(
            JsonOperationMetadata operationMetadata,
            Unmarshaller<T, JsonUnmarshallerContext> responseUnmarshaller); HttpResponseHandler<AmazonServiceException> createErrorResponseHandler(
            JsonErrorResponseMetadata errorResponsMetadata);  }