@Override
    public UpdateMetadataResponse getErrorResponse(int throttleTimeMs, Throwable e) {
        UpdateMetadataResponseData data = new UpdateMetadataResponseData()
                .setErrorCode(Errors.forException(e).code());
        return new UpdateMetadataResponse(data);
    }
@Test
    public void testGetErrorResponse() {
        for (short version : UPDATE_METADATA.allVersions()) {
            UpdateMetadataRequest.Builder builder = new UpdateMetadataRequest.Builder(
                    version, 0, 0, 0, Collections.emptyList(), Collections.emptyList(), Collections.emptyMap());
            UpdateMetadataRequest request = builder.build();
            UpdateMetadataResponse response = request.getErrorResponse(0,
                    new ClusterAuthorizationException("Not authorized"));
            assertEquals(Errors.CLUSTER_AUTHORIZATION_FAILED, response.error());
        }
    }