Skip to content

Commit ca5a14b

Browse files
committed
updates with disabled tests
1 parent 1ada490 commit ca5a14b

File tree

6 files changed

+28
-227
lines changed

6 files changed

+28
-227
lines changed

sdk/clientcore/annotation-processor-test/src/main/java/io/clientcore/annotation/processor/test/implementation/TestInterfaceClientImpl.java

-37
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import io.clientcore.annotation.processor.test.implementation.models.Foo;
77
import io.clientcore.annotation.processor.test.implementation.models.FooListResult;
8-
import io.clientcore.annotation.processor.test.implementation.models.HttpBinJSON;
98
import io.clientcore.core.annotations.ServiceInterface;
109
import io.clientcore.core.http.annotations.BodyParam;
1110
import io.clientcore.core.http.annotations.HeaderParam;
@@ -18,9 +17,7 @@
1817
import io.clientcore.core.http.models.RequestOptions;
1918
import io.clientcore.core.http.models.Response;
2019
import io.clientcore.core.http.pipeline.HttpPipeline;
21-
import io.clientcore.core.implementation.http.ContentType;
2220
import io.clientcore.core.models.binarydata.BinaryData;
23-
2421
import java.io.InputStream;
2522
import java.lang.reflect.InvocationTargetException;
2623
import java.nio.ByteBuffer;
@@ -100,39 +97,5 @@ Response<List<Foo>> listFoo(@HostParam("uri") String uri, @QueryParam(value = "t
10097
@HttpRequestInformation(method = HttpMethod.GET, path = "{nextLink}", expectedStatusCodes = { 200 })
10198
Response<List<Foo>> listNextFoo(@PathParam(value = "nextLink", encoded = true) String nextLink,
10299
RequestOptions requestOptions);
103-
// HttpClientTests
104-
// Need to add RequestOptions to specify ResponseBodyMode, which is otherwise provided by convenience methods
105-
@SuppressWarnings({ "unchecked", "cast" })
106-
@HttpRequestInformation(method = HttpMethod.PUT, path = "put", expectedStatusCodes = {200})
107-
default HttpBinJSON putConvenience(String uri, int putBody, RequestOptions options) {
108-
return putResponse(uri, putBody, options).getValue();
109-
}
110-
111-
@HttpRequestInformation(method = HttpMethod.PUT, path = "put", expectedStatusCodes = { 200 })
112-
Response<HttpBinJSON> putResponse(@HostParam("uri") String uri,
113-
@BodyParam(ContentType.APPLICATION_OCTET_STREAM) int putBody, RequestOptions options);
114-
115-
@HttpRequestInformation(method = HttpMethod.POST, path = "stream", expectedStatusCodes = { 200 })
116-
default HttpBinJSON postStreamConvenience(@HostParam("uri") String uri,
117-
@BodyParam(ContentType.APPLICATION_OCTET_STREAM) int putBody, RequestOptions options) {
118-
return postStreamResponse(uri, putBody, options).getValue();
119-
}
120-
121-
@HttpRequestInformation(method = HttpMethod.POST, path = "stream", expectedStatusCodes = { 200 })
122-
Response<HttpBinJSON> postStreamResponse(@HostParam("uri") String uri,
123-
@BodyParam(ContentType.APPLICATION_OCTET_STREAM) int putBody, RequestOptions options);
124-
125-
// Service 1
126-
@HttpRequestInformation(method = HttpMethod.GET, path = "bytes/100", expectedStatusCodes = {200})
127-
byte[] getByteArray(@HostParam("uri") String uri);
128-
129-
// Service 2
130-
@HttpRequestInformation(method = HttpMethod.GET, path = "bytes/{numberOfBytes}", expectedStatusCodes = { 200 })
131-
byte[] getByteArray(@HostParam("scheme") String scheme, @HostParam("hostName") String hostName,
132-
@PathParam("numberOfBytes") int numberOfBytes);
133-
134-
// Service 3
135-
@HttpRequestInformation(method = HttpMethod.GET, path = "bytes/100", expectedStatusCodes = { 200 })
136-
void getNothing(@HostParam("uri") String uri);
137100
}
138101
}

sdk/clientcore/annotation-processor-test/src/main/java/io/clientcore/annotation/processor/test/implementation/models/HttpBinJSON.java

-179
This file was deleted.

sdk/clientcore/annotation-processor-test/src/test/java/io/clientcore/annotation/processor/test/shared/HttpClientTests.java

+16-2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
import java.util.regex.Pattern;
6666
import java.util.stream.Stream;
6767
import org.junit.jupiter.api.Assertions;
68+
import org.junit.jupiter.api.Disabled;
6869
import org.junit.jupiter.api.Named;
6970
import org.junit.jupiter.api.Test;
7071
import org.junit.jupiter.api.parallel.Execution;
@@ -873,6 +874,7 @@ public void putRequestWithBodyAndEqualContentLength() {
873874
}
874875

875876
@Test
877+
@Disabled("https://github.com/Azure/azure-sdk-for-java/issues/43728")
876878
public void putRequestWithBodyLessThanContentLength() {
877879
ByteBuffer body = ByteBuffer.wrap("test".getBytes(StandardCharsets.UTF_8));
878880
Exception unexpectedLengthException = assertThrows(Exception.class, () -> {
@@ -895,6 +897,7 @@ public void putRequestWithBodyMoreThanContentLength() {
895897
}
896898

897899
@Test
900+
@Disabled("https://github.com/Azure/azure-sdk-for-java/issues/43728")
898901
public void putRequestWithUnexpectedResponseAndNoFallthroughExceptionType() {
899902
HttpResponseException e = assertThrows(HttpResponseException.class, () -> createService(Service9.class)
900903
.putWithUnexpectedResponseAndNoFallthroughExceptionType(getRequestUri(), "I'm the body!"));
@@ -1047,6 +1050,7 @@ static Service13 getNewInstance(HttpPipeline pipeline) {
10471050
private static final HttpHeaderName MY_OTHER_HEADER = HttpHeaderName.fromString("MyOtherHeader");
10481051

10491052
@Test
1053+
@Disabled("https://github.com/Azure/azure-sdk-for-java/pull/44750")
10501054
public void headersRequest() {
10511055
final HttpBinJSON json = createService(Service13.class).get(getRequestUri());
10521056

@@ -1231,6 +1235,7 @@ public void service18GetStatus300WithExpectedResponse300() {
12311235
}
12321236

12331237
@Test
1238+
@Disabled("https://github.com/Azure/azure-sdk-for-java/issues/43728")
12341239
public void service18GetStatus400() {
12351240
assertThrows(HttpResponseException.class, () -> createService(Service18.class).getStatus400(getRequestUri()));
12361241
}
@@ -1241,6 +1246,7 @@ public void service18GetStatus400WithExpectedResponse400() {
12411246
}
12421247

12431248
@Test
1249+
@Disabled("https://github.com/Azure/azure-sdk-for-java/issues/43728")
12441250
public void service18GetStatus500() {
12451251
assertThrows(HttpResponseException.class, () -> createService(Service18.class).getStatus500(getRequestUri()));
12461252
}
@@ -1715,6 +1721,7 @@ static UnexpectedOKService getNewInstance(HttpPipeline pipeline) {
17151721
}
17161722

17171723
@Test
1724+
@Disabled("https://github.com/Azure/azure-sdk-for-java/issues/43728")
17181725
public void unexpectedHTTPOK() {
17191726
HttpResponseException e = assertThrows(HttpResponseException.class,
17201727
() -> createService(UnexpectedOKService.class).getBytes(getRequestUri()));
@@ -1829,6 +1836,7 @@ Response<HttpBinJSON> put(@HostParam("uri") String host, @BodyParam("text/plain"
18291836
}
18301837

18311838
@Test
1839+
@Disabled("None of the provided serializers support the format: TEXT.")
18321840
public void binaryDataUploadTest() throws Exception {
18331841
Path filePath = Paths.get(getClass().getClassLoader().getResource("upload.txt").toURI());
18341842
BinaryData data = BinaryData.fromFile(filePath);
@@ -2154,6 +2162,7 @@ static Service29 getNewInstance(HttpPipeline pipeline) {
21542162

21552163
@ParameterizedTest
21562164
@MethodSource("voidErrorReturnsErrorBodySupplier")
2165+
@Disabled("https://github.com/Azure/azure-sdk-for-java/issues/43728")
21572166
public void voidErrorReturnsErrorBody(BiConsumer<String, Service29> executable) {
21582167
HttpResponseException exception = assertThrows(HttpResponseException.class,
21592168
() -> executable.accept(getServerUri(isSecure()), createService(Service29.class)));
@@ -2162,6 +2171,7 @@ public void voidErrorReturnsErrorBody(BiConsumer<String, Service29> executable)
21622171
}
21632172

21642173
@Test
2174+
@Disabled("https://github.com/Azure/azure-sdk-for-java/issues/44746")
21652175
public void canReceiveServerSentEvents() throws IOException {
21662176
final int[] i = { 0 };
21672177
ServerSentEventService service = createService(ServerSentEventService.class);
@@ -2194,6 +2204,7 @@ public void canReceiveServerSentEvents() throws IOException {
21942204
* Tests that eagerly converting implementation HTTP headers to Client Core Headers is done.
21952205
*/
21962206
@Test
2207+
@Disabled("https://github.com/Azure/azure-sdk-for-java/issues/44746")
21972208
public void canRecognizeServerSentEvent() throws IOException {
21982209
BinaryData requestBody = BinaryData.fromString("test body");
21992210
ServerSentEventService service = createService(ServerSentEventService.class);
@@ -2209,6 +2220,7 @@ public void canRecognizeServerSentEvent() throws IOException {
22092220
}
22102221

22112222
@Test
2223+
@Disabled("https://github.com/Azure/azure-sdk-for-java/issues/44746")
22122224
public void onErrorServerSentEvents() throws IOException {
22132225
ServerSentEventService service = createService(ServerSentEventService.class);
22142226

@@ -2230,6 +2242,7 @@ public void onError(Throwable throwable) {
22302242
}
22312243

22322244
@Test
2245+
@Disabled("https://github.com/Azure/azure-sdk-for-java/issues/44746")
22332246
public void onRetryWithLastEventIdReceiveServerSentEvents() throws IOException {
22342247
ServerSentEventService service = createService(ServerSentEventService.class);
22352248

@@ -2260,6 +2273,7 @@ public void onEvent(ServerSentEvent sse) {
22602273
* Test throws Runtime exception for no listener attached.
22612274
*/
22622275
@Test
2276+
@Disabled("https://github.com/Azure/azure-sdk-for-java/issues/44746")
22632277
public void throwsExceptionForNoListener() {
22642278
ServerSentEventService service = createService(ServerSentEventService.class);
22652279
BinaryData requestBody = BinaryData.fromString("test body");
@@ -2279,7 +2293,7 @@ static Service30 getNewInstance(HttpPipeline pipeline) {
22792293
throw new IllegalArgumentException("pipeline cannot be null");
22802294
}
22812295
try {
2282-
Class<?> clazz = Class.forName("io.clientcore.annotation.processor.test.shared" +
2296+
Class<?> clazz = Class.forName("io.clientcore.annotation.processor.test.shared." +
22832297
"Service30Impl");
22842298
return (Service30) clazz
22852299
.getMethod("getNewInstance", HttpPipeline.class)
@@ -2314,7 +2328,7 @@ static ServerSentEventService getNewInstance(HttpPipeline pipeline) {
23142328
throw new IllegalArgumentException("pipeline cannot be null");
23152329
}
23162330
try {
2317-
Class<?> clazz = Class.forName("io.clientcore.annotation.processor.test.shared" +
2331+
Class<?> clazz = Class.forName("io.clientcore.annotation.processor.test.shared." +
23182332
"ServerSentEventServiceImpl");
23192333
return (ServerSentEventService) clazz
23202334
.getMethod("getNewInstance", HttpPipeline.class)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The quick brown fox jumps over the lazy dog

sdk/clientcore/annotation-processor/src/main/java/io/clientcore/annotation/processor/AnnotationProcessor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ private HttpRequestContext createHttpRequestContext(ExecutableElement requestMet
197197
}
198198

199199
private static String getHost(TemplateInput templateInput, HttpRequestContext method, boolean isEncoded) {
200-
String rawHost;
200+
String rawHost = null;
201201
if (isEncoded) {
202-
rawHost = method.getPath();
202+
rawHost = templateInput.getHost() + "/" + method.getPath();
203203
} else {
204204
String host = templateInput.getHost();
205205
String path = method.getPath();

0 commit comments

Comments
 (0)