HttpClientTests Classe
- java.
lang. Object - com.
azure. core. test. http. HttpClientTests
- com.
public abstract class HttpClientTests
Pacote de teste genérico para HttpClient.
Resumo do campo
Modificador e tipo | Campo e descrição |
---|---|
protected static final String | ECHO_RESPONSE |
Resumo do Construtor
Construtor | Description | |
---|---|---|
HttpClientTests() |
Resumo do método
Métodos herdados de java.lang.Object
Detalhes do campo
ECHO_RESPONSE
protected static final String ECHO_RESPONSE
Detalhes do construtor
HttpClientTests
public HttpClientTests()
Detalhes do método
createService
protected T
Parameters:
createService
protected T
Parameters:
asyncCompletableHeadRequest
public void asyncCompletableHeadRequest()
asyncDeleteRequest
public void asyncDeleteRequest()
asyncGetRequestWithAnything
public void asyncGetRequestWithAnything()
asyncGetRequestWithHeaderParametersAndAnything
public void asyncGetRequestWithHeaderParametersAndAnything()
asyncGetRequestWithNoReturn
public void asyncGetRequestWithNoReturn()
Testa se uma resposta sem tipo de retorno é tratada corretamente.
asyncGetRequestWithQueryParametersAndAnything
public void asyncGetRequestWithQueryParametersAndAnything()
asyncHeadBooleanRequest
public void asyncHeadBooleanRequest()
asyncHeadRequest
public void asyncHeadRequest()
asyncHeadersRequest
public void asyncHeadersRequest()
asyncHttpsHeadersRequest
public void asyncHttpsHeadersRequest()
asyncPatchRequest
public void asyncPatchRequest()
asyncPostRequestWithStringBody
public void asyncPostRequestWithStringBody()
asyncPutRequestWithBinaryDataBodyAndEqualContentLength
public void asyncPutRequestWithBinaryDataBodyAndEqualContentLength()
asyncPutRequestWithBinaryDataBodyAndLessThanContentLength
public void asyncPutRequestWithBinaryDataBodyAndLessThanContentLength()
asyncPutRequestWithBinaryDataBodyAndMoreThanContentLength
public void asyncPutRequestWithBinaryDataBodyAndMoreThanContentLength()
asyncPutRequestWithBodyAndEqualContentLength
public void asyncPutRequestWithBodyAndEqualContentLength()
asyncPutRequestWithBodyAndLessThanContentLength
public void asyncPutRequestWithBodyAndLessThanContentLength()
asyncPutRequestWithBodyAndMoreThanContentLength
public void asyncPutRequestWithBodyAndMoreThanContentLength()
asyncPutRequestWithIntBody
public void asyncPutRequestWithIntBody()
asyncPutRequestWithStreamBinaryDataBodyAndLessThanContentLength
public void asyncPutRequestWithStreamBinaryDataBodyAndLessThanContentLength()
LengthValidatingInputStream no proxy rest depende do leitor chegar ao EOF. Esse teste tem como destino especificamente InputStream para declarar esse comportamento.
asyncPutRequestWithStreamBinaryDataBodyAndMoreThanContentLength
public void asyncPutRequestWithStreamBinaryDataBodyAndMoreThanContentLength()
LengthValidatingInputStream no proxy rest depende do leitor chegar ao EOF. Esse teste tem como destino especificamente InputStream para declarar esse comportamento.
asyncPutRequestWithUnexpectedResponse
public void asyncPutRequestWithUnexpectedResponse()
asyncPutRequestWithUnexpectedResponseAndDeterminedExceptionType
public void asyncPutRequestWithUnexpectedResponseAndDeterminedExceptionType()
asyncPutRequestWithUnexpectedResponseAndExceptionType
public void asyncPutRequestWithUnexpectedResponseAndExceptionType()
asyncPutRequestWithUnexpectedResponseAndFallthroughExceptionType
public void asyncPutRequestWithUnexpectedResponseAndFallthroughExceptionType()
asyncPutRequestWithUnexpectedResponseAndNoFallthroughExceptionType
public void asyncPutRequestWithUnexpectedResponseAndNoFallthroughExceptionType()
asyncRequestWithByteArrayReturnType
public void asyncRequestWithByteArrayReturnType()
Testa se o corpo da resposta é retornado corretamente como uma matriz de bytes.
asyncRequestWithByteArrayReturnTypeAndParameterizedHostAndPath
public void asyncRequestWithByteArrayReturnTypeAndParameterizedHostAndPath()
Testa se o corpo da resposta é retornado corretamente como uma matriz de bytes.
asyncRequestWithMultipleHostParams
public void asyncRequestWithMultipleHostParams()
binaryDataUploadTest
bomWithDifferentHeader
public void bomWithDifferentHeader()
Testa se uma resposta com um marcador de ordem de byte e o cabeçalho 'Content-Type' adiará o uso da codificação BOM.
bomWithSameHeader
public void bomWithSameHeader()
Testa se uma resposta com um marcador de ordem de byte e o cabeçalho 'Content-Type' adiará o uso da codificação BOM.
bufferedResponseCanBeReadMultipleTimes
public void bufferedResponseCanBeReadMultipleTimes()
Os testes que armazenam a resposta em buffer são de fato armazenados em buffer, ou seja, o conteúdo pode ser acessado muitas vezes.
Throws:
canAccessResponseBody
public void canAccessResponseBody()
Testes que podem ser acessados pelo corpo da resposta sem buffer.
Throws:
canSendBinaryData
public void canSendBinaryData(BinaryData requestBody, byte[] expectedResponseBody)
Testes que enviam bytes aleatórios de várias formas para um ponto de extremidade que ecoa bytes de volta para o remetente.
Parameters:
canSendBinaryDataSync
public void canSendBinaryDataSync(BinaryData requestBody, byte[] expectedResponseBody)
Testes que enviam bytes aleatórios de várias formas para um ponto de extremidade que ecoa bytes de volta para o remetente.
Parameters:
canSendBinaryDataWithProgressReporting
public void canSendBinaryDataWithProgressReporting(BinaryData requestBody, byte[] expectedResponseBody)
Testes que enviam bytes aleatórios de várias formas para um ponto de extremidade que ecoa bytes de volta para o remetente.
Parameters:
canSendBinaryDataWithProgressReportingSync
public void canSendBinaryDataWithProgressReportingSync(BinaryData requestBody, byte[] expectedResponseBody)
Testes que enviam bytes aleatórios de várias formas para um ponto de extremidade que ecoa bytes de volta para o remetente.
Parameters:
createHttpClient
protected abstract HttpClient createHttpClient()
Obtenha o cliente HTTP que será usado para cada teste. Isso será chamado uma vez por teste.
Returns:
downloadTestArgumentProvider
public static Stream
eagerlyConvertedHeadersAreHttpHeaders
public void eagerlyConvertedHeadersAreHttpHeaders()
Testes que convertem ansiosamente cabeçalhos HTTP de implementação em HttpHeaders azure-core são feitos.
fluxUploadTest
getByteArrayAsyncWithNoExpectedResponses
public void getByteArrayAsyncWithNoExpectedResponses()
Testa se o corpo da resposta é retornado corretamente como uma matriz de bytes.
getPort
@Deprecated
protected abstract int getPort()
Preterido
Obtenha a porta dinâmica que o servidor está usando para rotear corretamente a solicitação.
Returns:
getRequestUrl
protected URL getRequestUrl(String requestPath)
Obtém a URL de solicitação para determinado caminho.
Parameters:
Returns:
getServerUri
protected abstract String getServerUri(boolean secure)
Obtém o URI dinâmico que o servidor está usando para rotear corretamente a solicitação.
Parameters:
Returns:
headerResponse
public void headerResponse()
Testa se uma resposta com um cabeçalho 'Content-Type' codifica usando o conjunto de caracteres especificado.
invalidHeaderResponse
public void invalidHeaderResponse()
Testa se uma resposta com um 'Content-Type' que contém um conjunto de caracteres inválido ou sem suporte codifica usando UTF-8.
isSecure
protected boolean isSecure()
Obtenha um sinalizador que indica se a comunicação deve ser protegida ou não (https ou http).
Returns:
plainResponse
public void plainResponse()
Testa se uma resposta sem uma marca de ordem de byte ou um cabeçalho 'Content-Type' codifica usando UTF-8.
postUrlForm
public void postUrlForm()
postUrlFormEncoded
public void postUrlFormEncoded()
rawFluxDownloadTest
public void rawFluxDownloadTest()
requestOptionsAddAHeader
public void requestOptionsAddAHeader()
requestOptionsChangesBody
public void requestOptionsChangesBody()
requestOptionsChangesBodyAndContentLength
public void requestOptionsChangesBodyAndContentLength()
requestOptionsSetsAHeader
public void requestOptionsSetsAHeader()
segmentUploadTest
service16Put
public void service16Put()
service16PutAsync
public void service16PutAsync()
service18GetStatus200
public void service18GetStatus200()
service18GetStatus200WithExpectedResponse200
public void service18GetStatus200WithExpectedResponse200()
service18GetStatus300
public void service18GetStatus300()
service18GetStatus300WithExpectedResponse300
public void service18GetStatus300WithExpectedResponse300()
service18GetStatus400
public void service18GetStatus400()
service18GetStatus400WithExpectedResponse400
public void service18GetStatus400WithExpectedResponse400()
service18GetStatus500
public void service18GetStatus500()
service18GetStatus500WithExpectedResponse500
public void service18GetStatus500WithExpectedResponse500()
service19PutWithBodyParamApplicationJsonContentTypeAndByteArrayBodyWithEmptyBody
public void service19PutWithBodyParamApplicationJsonContentTypeAndByteArrayBodyWithEmptyBody()
service19PutWithBodyParamApplicationJsonContentTypeAndByteArrayBodyWithNonEmptyBody
public void service19PutWithBodyParamApplicationJsonContentTypeAndByteArrayBodyWithNonEmptyBody()
service19PutWithBodyParamApplicationJsonContentTypeAndByteArrayBodyWithNullBody
public void service19PutWithBodyParamApplicationJsonContentTypeAndByteArrayBodyWithNullBody()
service19PutWithBodyParamApplicationJsonContentTypeAndCharsetAndStringBodyWithEmptyBody
public void service19PutWithBodyParamApplicationJsonContentTypeAndCharsetAndStringBodyWithEmptyBody()
service19PutWithBodyParamApplicationJsonContentTypeAndCharsetAndStringBodyWithNonEmptyBody
public void service19PutWithBodyParamApplicationJsonContentTypeAndCharsetAndStringBodyWithNonEmptyBody()
service19PutWithBodyParamApplicationJsonContentTypeAndCharsetAndStringBodyWithNullBody
public void service19PutWithBodyParamApplicationJsonContentTypeAndCharsetAndStringBodyWithNullBody()
service19PutWithBodyParamApplicationJsonContentTypeAndStringBodyWithEmptyBody
public void service19PutWithBodyParamApplicationJsonContentTypeAndStringBodyWithEmptyBody()
service19PutWithBodyParamApplicationJsonContentTypeAndStringBodyWithNonEmptyBody
public void service19PutWithBodyParamApplicationJsonContentTypeAndStringBodyWithNonEmptyBody()
service19PutWithBodyParamApplicationJsonContentTypeAndStringBodyWithNullBody
public void service19PutWithBodyParamApplicationJsonContentTypeAndStringBodyWithNullBody()
service19PutWithBodyParamApplicationOctetStreamContentTypeAndByteArrayBodyWithEmptyBody
public void service19PutWithBodyParamApplicationOctetStreamContentTypeAndByteArrayBodyWithEmptyBody()
service19PutWithBodyParamApplicationOctetStreamContentTypeAndByteArrayBodyWithNonEmptyBody
public void service19PutWithBodyParamApplicationOctetStreamContentTypeAndByteArrayBodyWithNonEmptyBody()
service19PutWithBodyParamApplicationOctetStreamContentTypeAndByteArrayBodyWithNullBody
public void service19PutWithBodyParamApplicationOctetStreamContentTypeAndByteArrayBodyWithNullBody()
service19PutWithBodyParamApplicationOctetStreamContentTypeAndStringBodyWithEmptyBody
public void service19PutWithBodyParamApplicationOctetStreamContentTypeAndStringBodyWithEmptyBody()
service19PutWithBodyParamApplicationOctetStreamContentTypeAndStringBodyWithNonEmptyBody
public void service19PutWithBodyParamApplicationOctetStreamContentTypeAndStringBodyWithNonEmptyBody()
service19PutWithBodyParamApplicationOctetStreamContentTypeAndStringBodyWithNullBody
public void service19PutWithBodyParamApplicationOctetStreamContentTypeAndStringBodyWithNullBody()
service19PutWithHeaderApplicationJsonContentTypeAndByteArrayBodyWithEmptyBody
public void service19PutWithHeaderApplicationJsonContentTypeAndByteArrayBodyWithEmptyBody()
service19PutWithHeaderApplicationJsonContentTypeAndByteArrayBodyWithNonEmptyBody
public void service19PutWithHeaderApplicationJsonContentTypeAndByteArrayBodyWithNonEmptyBody()
service19PutWithHeaderApplicationJsonContentTypeAndByteArrayBodyWithNullBody
public void service19PutWithHeaderApplicationJsonContentTypeAndByteArrayBodyWithNullBody()
service19PutWithHeaderApplicationJsonContentTypeAndCharsetAndStringBodyWithEmptyBody
public void service19PutWithHeaderApplicationJsonContentTypeAndCharsetAndStringBodyWithEmptyBody()
service19PutWithHeaderApplicationJsonContentTypeAndCharsetAndStringBodyWithNonEmptyBody
public void service19PutWithHeaderApplicationJsonContentTypeAndCharsetAndStringBodyWithNonEmptyBody()
service19PutWithHeaderApplicationJsonContentTypeAndCharsetAndStringBodyWithNullBody
public void service19PutWithHeaderApplicationJsonContentTypeAndCharsetAndStringBodyWithNullBody()
service19PutWithHeaderApplicationJsonContentTypeAndStringBodyWithEmptyBody
public void service19PutWithHeaderApplicationJsonContentTypeAndStringBodyWithEmptyBody()
service19PutWithHeaderApplicationJsonContentTypeAndStringBodyWithNonEmptyBody
public void service19PutWithHeaderApplicationJsonContentTypeAndStringBodyWithNonEmptyBody()
service19PutWithHeaderApplicationJsonContentTypeAndStringBodyWithNullBody
public void service19PutWithHeaderApplicationJsonContentTypeAndStringBodyWithNullBody()
service19PutWithHeaderApplicationOctetStreamContentTypeAndByteArrayBodyWithEmptyBody
public void service19PutWithHeaderApplicationOctetStreamContentTypeAndByteArrayBodyWithEmptyBody()
service19PutWithHeaderApplicationOctetStreamContentTypeAndByteArrayBodyWithNonEmptyBody
public void service19PutWithHeaderApplicationOctetStreamContentTypeAndByteArrayBodyWithNonEmptyBody()
service19PutWithHeaderApplicationOctetStreamContentTypeAndByteArrayBodyWithNullBody
public void service19PutWithHeaderApplicationOctetStreamContentTypeAndByteArrayBodyWithNullBody()
service19PutWithHeaderApplicationOctetStreamContentTypeAndStringBodyWithEmptyBody
public void service19PutWithHeaderApplicationOctetStreamContentTypeAndStringBodyWithEmptyBody()
service19PutWithHeaderApplicationOctetStreamContentTypeAndStringBodyWithNonEmptyBody
public void service19PutWithHeaderApplicationOctetStreamContentTypeAndStringBodyWithNonEmptyBody()
service19PutWithHeaderApplicationOctetStreamContentTypeAndStringBodyWithNullBody
public void service19PutWithHeaderApplicationOctetStreamContentTypeAndStringBodyWithNullBody()
service19PutWithNoContentTypeAndByteArrayBodyWithEmptyBody
public void service19PutWithNoContentTypeAndByteArrayBodyWithEmptyBody()
service19PutWithNoContentTypeAndByteArrayBodyWithNonEmptyBody
public void service19PutWithNoContentTypeAndByteArrayBodyWithNonEmptyBody()
service19PutWithNoContentTypeAndByteArrayBodyWithNullBody
public void service19PutWithNoContentTypeAndByteArrayBodyWithNullBody()
service19PutWithNoContentTypeAndStringBodyWithEmptyBody
public void service19PutWithNoContentTypeAndStringBodyWithEmptyBody()
service19PutWithNoContentTypeAndStringBodyWithNonEmptyBody
public void service19PutWithNoContentTypeAndStringBodyWithNonEmptyBody()
service19PutWithNoContentTypeAndStringBodyWithNullBody
public void service19PutWithNoContentTypeAndStringBodyWithNullBody()
service20GetBytes100BodyAndHeaders
public void service20GetBytes100BodyAndHeaders()
service20GetBytes100OnlyHeaders
public void service20GetBytes100OnlyHeaders()
service20GetBytesOnlyHeaders
public void service20GetBytesOnlyHeaders()
service20GetBytesOnlyStatus
public void service20GetBytesOnlyStatus()
service20GetResponseBody
public void service20GetResponseBody()
service20GetVoidResponse
public void service20GetVoidResponse()
service20PutBodyAndHeaders
public void service20PutBodyAndHeaders()
service20PutOnlyHeaders
public void service20PutOnlyHeaders()
service21GetBytes100
public void service21GetBytes100()
service22GetBytes
public void service22GetBytes()
service23GetBytes
public void service23GetBytes()
service24Put
public void service24Put()
shouldBufferResponse
public void shouldBufferResponse()
Testa se o cliente retorna a resposta em buffer se solicitado por meio do sinalizador de contexto azure-eagerly-read-response.
simpleDownloadTest
public void simpleDownloadTest(Context context)
Parameters:
simpleDownloadTestAsync
public void simpleDownloadTestAsync(Context context)
Parameters:
streamResponseCanTransferBody
streamResponseCanTransferBodyAsync
public void streamResponseCanTransferBodyAsync(Context context)
Parameters:
Throws:
syncDeleteRequest
public void syncDeleteRequest()
syncGetRequestWithAnything
public void syncGetRequestWithAnything()
syncGetRequestWithAnythingWithEncodedPathParam
public void syncGetRequestWithAnythingWithEncodedPathParam()
syncGetRequestWithAnythingWithEncodedPathParamWithPercent20
public void syncGetRequestWithAnythingWithEncodedPathParamWithPercent20()
syncGetRequestWithAnythingWithEncodedPathParamWithPlus
public void syncGetRequestWithAnythingWithEncodedPathParamWithPlus()
syncGetRequestWithAnythingWithPathParam
public void syncGetRequestWithAnythingWithPathParam()
syncGetRequestWithAnythingWithPathParamWithPlus
public void syncGetRequestWithAnythingWithPathParamWithPlus()
syncGetRequestWithAnythingWithPathParamWithSpace
public void syncGetRequestWithAnythingWithPathParamWithSpace()
syncGetRequestWithAnythingWithPlus
public void syncGetRequestWithAnythingWithPlus()
syncGetRequestWithHeaderParametersAndAnythingReturn
public void syncGetRequestWithHeaderParametersAndAnythingReturn()
syncGetRequestWithNoReturn
public void syncGetRequestWithNoReturn()
Testa se uma resposta sem tipo de retorno é tratada corretamente.
syncGetRequestWithNullHeader
public void syncGetRequestWithNullHeader()
syncGetRequestWithNullQueryParameter
public void syncGetRequestWithNullQueryParameter()
syncGetRequestWithQueryParametersAndAnything
public void syncGetRequestWithQueryParametersAndAnything()
syncGetRequestWithQueryParametersAndAnythingWithEncodedWithPercent20
public void syncGetRequestWithQueryParametersAndAnythingWithEncodedWithPercent20()
syncGetRequestWithQueryParametersAndAnythingWithPercent20
public void syncGetRequestWithQueryParametersAndAnythingWithPercent20()
syncHeadBooleanRequest
public void syncHeadBooleanRequest()
syncHeadRequest
public void syncHeadRequest()
syncHeadersRequest
public void syncHeadersRequest()
syncPatchRequest
public void syncPatchRequest()
syncPostRequestWithNullBody
public void syncPostRequestWithNullBody()
syncPostRequestWithStringBody
public void syncPostRequestWithStringBody()
syncPutRequestWithBodyAndEqualContentLength
public void syncPutRequestWithBodyAndEqualContentLength()
syncPutRequestWithBodyLessThanContentLength
public void syncPutRequestWithBodyLessThanContentLength()
syncPutRequestWithBodyMoreThanContentLength
public void syncPutRequestWithBodyMoreThanContentLength()
syncPutRequestWithIntBody
public void syncPutRequestWithIntBody()
syncPutRequestWithUnexpectedResponse
public void syncPutRequestWithUnexpectedResponse()
syncPutRequestWithUnexpectedResponseAndDeterminedExceptionType
public void syncPutRequestWithUnexpectedResponseAndDeterminedExceptionType()
syncPutRequestWithUnexpectedResponseAndExceptionType
public void syncPutRequestWithUnexpectedResponseAndExceptionType()
syncPutRequestWithUnexpectedResponseAndFallthroughExceptionType
public void syncPutRequestWithUnexpectedResponseAndFallthroughExceptionType()
syncPutRequestWithUnexpectedResponseAndNoFallthroughExceptionType
public void syncPutRequestWithUnexpectedResponseAndNoFallthroughExceptionType()
syncRequestWithByteArrayReturnType
public void syncRequestWithByteArrayReturnType()
Testa se o corpo da resposta é retornado corretamente como uma matriz de bytes.
syncRequestWithByteArrayReturnTypeAndParameterizedHostAndPath
public void syncRequestWithByteArrayReturnTypeAndParameterizedHostAndPath()
Testa se o corpo da resposta é retornado corretamente como uma matriz de bytes.
syncRequestWithEmptyByteArrayReturnTypeAndParameterizedHostAndPath
public void syncRequestWithEmptyByteArrayReturnTypeAndParameterizedHostAndPath()
Testa se o corpo da resposta é retornado corretamente como uma matriz de bytes.
syncRequestWithMultipleHostParams
public void syncRequestWithMultipleHostParams()
syncVoidHeadRequest
public void syncVoidHeadRequest()
unexpectedHTTPOK
public void unexpectedHTTPOK()
utf16BeBomResponse
public void utf16BeBomResponse()
Testa se uma resposta com uma marca de ordem de byte codifica usando o conjunto de caracteres especificado.
utf16LeBomResponse
public void utf16LeBomResponse()
Testa se uma resposta com uma marca de ordem de byte codifica usando o conjunto de caracteres especificado.
utf32BeBomResponse
public void utf32BeBomResponse()
Testa se uma resposta com uma marca de ordem de byte codifica usando o conjunto de caracteres especificado.
utf32LeBomResponse
public void utf32LeBomResponse()
Testa se uma resposta com uma marca de ordem de byte codifica usando o conjunto de caracteres especificado.
utf8BomResponse
public void utf8BomResponse()
Testa se uma resposta com uma marca de ordem de byte codifica usando o conjunto de caracteres especificado.
voidDoesNotEagerlyReadResponse
public void voidDoesNotEagerlyReadResponse(BiConsumer
Parameters:
voidErrorReturnsErrorBody
public void voidErrorReturnsErrorBody(BiConsumer
Parameters:
Aplica-se a
Azure SDK for Java