use of com.microsoft.azure.sdk.iot.deps.serializer.MethodParser in project azure-iot-sdk-java by Azure.
the class MethodParserTest method toJson_failed.
/* Tests_SRS_METHODPARSER_21_036: [If the method operation is `none`, the toJson shall throw IllegalArgumentException.] */
@Test(expected = IllegalArgumentException.class)
public void toJson_failed() {
// Arrange
MethodParser methodParser = new MethodParser();
// Act
methodParser.toJson();
}
use of com.microsoft.azure.sdk.iot.deps.serializer.MethodParser in project azure-iot-sdk-java by Azure.
the class MethodParserTest method toJson_payload_succeed.
/**
* Tests_SRS_METHODPARSER_21_028: [If the method operation is `payload`, the toJson shall parse only the payload.]
* Ex:
* {
* "input1": "someInput",
* "input2": "anotherInput"
* }
*/
@Test
public void toJson_payload_succeed() {
for (TestMethod testCase : successTestResult) {
// Arrange
MethodParser methodParser = new MethodParser(testCase.payload);
// Act
String json = methodParser.toJson();
// Assert
Helpers.assertJson(json, testCase.json);
}
}
use of com.microsoft.azure.sdk.iot.deps.serializer.MethodParser in project azure-iot-sdk-java by Azure.
the class MethodParserTest method Constructor_succeed.
/* Tests_SRS_METHODPARSER_21_029: [The constructor shall create an instance of the methodParser.] */
/* Tests_SRS_METHODPARSER_21_030: [The constructor shall initialize all data in the collection as null.] */
/* Tests_SRS_METHODPARSER_21_022: [The constructor shall initialize the method operation as `none`.] */
@Test
public void Constructor_succeed() {
// Arrange
// Act
MethodParser methodParser = new MethodParser();
// Assert
assertMethod(methodParser, null, null, null, null, null, "none");
}
Aggregations