+ Start a Discussion
Rajeesh vrRajeesh vr 

Getting Invalid type error for test class return type

I have REST API post with return type. 

global class ReturnClass {

        global String success;
        global String message;
        global map<String,Decimal> records;

        global ReturnClass(String success, String message, map<String,Decimal> records) {
          this.success = success;
          this.message = message;
          this.records = records;
        }

    }

and I have defined the class as:
global static ReturnClass doPost(id invoiceId, id userId, double amount, boolean acceptPartialBid, id contactId) 
And I have used the same in the test as given below. 
RestReceiveBid.ReturnClass results = RestReceiveBid.doPost(invoiceID, funderID, amount, acceptPartialBid, contactID);

After som etime when I tried to delete the est class from eclipse IDE, I got the folowing error while validating the deployemnt. 

Test_RestReceiveBid. line 48, column 5: Invalid type: RestReceiveBid.ReturnClass

But the strange thing the test class is running success in sandbox. Not sure what went wrong here or what was missing. 

Can anyone please point out the issue here?