I am new to apex callouts and trying to do some JSON parsing. I used the online tool https://www.adminbooster.com/tool/json2apex which worked great.
I got a class and a testclass from the adminbooster. I am calling the class as an object in my testclass but get folowwing error:
Method does not exist or incorrect signature: void parse(String) from the type or_propertyJSONTest.
My Class:
public class or_propertyJSON{
public ..
public ..
class cls_photos {
}
class cls_bedTypes {
public ..
public ..
}
public static or_propertyJSON parse(String json){
return (or_propertyJSON) System.JSON.deserialize(json, or_propertyJSON.class);
}
}
My testclass:
@isTest
public class or_propertyJSONTest {
static testMethod void testParse() {
String json= '{"..":"..",".."}';
or_propertyJSON obj = parse(json);
System.assert(obj != null);
}
}