Skip to content

[http-client-java]mgmt mock test, fix HEAD operation tests - #6969

Merged
Xiaofei Cao (XiaofeiCao) merged 6 commits into
mainfrom
java_mgmt_mocktest_boolean
Apr 15, 2025
Merged

[http-client-java]mgmt mock test, fix HEAD operation tests#6969
Xiaofei Cao (XiaofeiCao) merged 6 commits into
mainfrom
java_mgmt_mocktest_boolean

Conversation

@XiaofeiCao

@XiaofeiCaoXiaofei Cao (XiaofeiCao) commented Apr 14, 2025

Copy link
Copy Markdown
Member

fixAzure/autorest.java#1861 (comment)

generated mock test:

@TestpublicvoidtestCheckEntityExistsWithResponse() throwsException {
StringresponseStr = "false";
HttpClienthttpClient
= response -> Mono.just(newMockHttpResponse(response, 204, responseStr.getBytes(StandardCharsets.UTF_8)));
ApiManagementManagermanager = ApiManagementManager.configure()
.withHttpClient(httpClient)
.authenticate(tokenRequestContext -> Mono.just(newAccessToken("this_is_a_token", OffsetDateTime.MAX)),
newAzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD));
booleanresponse = manager.groupUsers()
.checkEntityExistsWithResponse("sdgktluifiqg", "qcpenob", "ysbeespqbvvaersz", "ufzsautbric",
com.azure.core.util.Context.NONE)
.getValue();
Assertions.assertTrue(response);
}

String ResponseStr = "false" will be in response body, and can be ignored.

@microsoft-github-policy-servicemicrosoft-github-policy-serviceBot added the emitter:client:java Issue for the Java client emitter: @typespec/http-client-java label Apr 14, 2025
@github-actions

Copy link
Copy Markdown
Contributor

No changes needing a change description found.

@azure-sdk

Azure SDK Bot (azure-sdk) commented Apr 14, 2025

Copy link
Copy Markdown
Collaborator

You can try these changes here

🛝 Playground🌐 Website🛝 VSCode Extension

@XiaofeiCaoXiaofei Cao (XiaofeiCao) changed the title mgmt mock test, fix client methods with Boolean response[http-client-java]mgmt mock test, fix client methods with Boolean responseApr 14, 2025
@XiaofeiCaoXiaofei Cao (XiaofeiCao) changed the title [http-client-java]mgmt mock test, fix client methods with Boolean response[http-client-java]mgmt mock test, fix HEAD operation testsApr 15, 2025
@XiaofeiCao
Xiaofei Cao (XiaofeiCao) added this pull request to the merge queueApr 15, 2025
Merged via the queue into main with commit 51a37adApr 15, 2025
@XiaofeiCao
Xiaofei Cao (XiaofeiCao) deleted the java_mgmt_mocktest_boolean branch April 15, 2025 08:32
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:javaIssue for the Java client emitter: @typespec/http-client-java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mgmt, investigate some failure with generated tests

3 participants

@XiaofeiCao@azure-sdk@weidongxu-microsoft