-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #938 from microsoft/bugfix/get-child-node
- fixes get child node on missing property
- Loading branch information
Showing
4 changed files
with
37 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...erialization/json/src/test/java/com/microsoft/kiota/serialization/JsonParseNodeTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.microsoft.kiota.serialization; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNull; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.ByteArrayInputStream; | ||
import java.io.UnsupportedEncodingException; | ||
|
||
class JsonParseNodeTests { | ||
private static final JsonParseNodeFactory _parseNodeFactory = new JsonParseNodeFactory(); | ||
private static final JsonSerializationWriterFactory _serializationWriterFactory = | ||
new JsonSerializationWriterFactory(); | ||
private static final String contentType = "application/json"; | ||
|
||
@Test | ||
void ItDDoesNotFailForGetChildElementOnMissingKey() throws UnsupportedEncodingException { | ||
final var initialString = "{displayName\": \"Microsoft Teams Meeting\"}"; | ||
final var rawResponse = new ByteArrayInputStream(initialString.getBytes("UTF-8")); | ||
final var parseNode = _parseNodeFactory.getParseNode(contentType, rawResponse); | ||
final var result = parseNode.getChildNode("@odata.type"); | ||
assertNull(result); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters