microsoft / kiota-java

Java libraries for Kiota-generated API clients.
https://aka.ms/kiota/docs
MIT License
22 stars 23 forks source link

Refactor to Eliminate Repetitive Mock Object Creation in OkHttpRequestAdapterTest.java #1387

Closed gzhao9 closed 2 weeks ago

gzhao9 commented 2 weeks ago

Pull Request Title:

Refactor RequestInformationTest to Reduce Redundancy and Simplify Mock Creation。

Pull Request Description:

This pull request addresses issue #1386, which is essentially doing the same thing as issue #1374. It refactors the OkHttpRequestAdapterTest class to eliminate redundant mock creations and simplify the testing code. Specifically, it introduces helper methods to centralize the creation and configuration of mocks for Parsable, ParseNode and ParseNodeFactory, reducing code duplication and enhancing readability.