Skip to content

Commit 5f59678

Browse files
committed
docs: add javadoc to related test utils
1 parent 583378e commit 5f59678

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

oauth2_http/javatests/com/google/auth/TestUtils.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ public static InputStream stringToInputStream(String text) {
101101
}
102102
}
103103

104+
/**
105+
* Parses a URI query string into a map of key-value pairs.
106+
*
107+
* @param query The URI query string (e.g., "key1=val1&key2=val2").
108+
* @return A map of decoded keys to decoded values.
109+
* @throws IOException If the query string is malformed.
110+
*/
104111
public static Map<String, String> parseQuery(String query) throws IOException {
105112
Map<String, String> map = new HashMap<>();
106113
Iterable<String> entries = Splitter.on('&').split(query);
@@ -116,6 +123,13 @@ public static Map<String, String> parseQuery(String query) throws IOException {
116123
return map;
117124
}
118125

126+
/**
127+
* Parses a JSON string into a map of key-value pairs.
128+
*
129+
* @param content The JSON string representation of a flat object.
130+
* @return A map of keys to string representations of their values.
131+
* @throws IOException If the JSON is malformed.
132+
*/
119133
public static Map<String, String> parseJson(String content) throws IOException {
120134
GenericJson json = JSON_FACTORY.fromString(content, GenericJson.class);
121135
Map<String, String> map = new HashMap<>();

0 commit comments

Comments
 (0)