+ Start a Discussion
rossella ladogana 6rossella ladogana 6 

Apex test class fails: Your classId property is missing or null. Provide id of an Apex class that have test methods

Hello,
as i wrote in the title i've got this issue. the two classes i use are those:
@isTest
public class ContainsProvaTest {
    static testMethod void prova(){
        ContainsProva prova1 = new ContainsProva();
        prova1.contains();
        
    }
}

public with sharing class ContainsProva {
    public void contains() {
        String name = 'Rossella';
        boolean result = name.contains('Ros');
        System.debug('Result is' + result);
    }
  
}

Both classes are inside an Apex sandbox project.

Configuration

test configuration

What's wrong with that?

I read that it could be a bug of salesforce. Can anyone helps me?

Thanks

Rossella
Swaraj Behera 7Swaraj Behera 7
Hi Rossella,

I have tested in my Org.It isworking perfectly fine with 100% code coverage.
Please find below screen shot.
Test Class Pass



100% code coverage

I hope it helps.

Thanks,
Swaraj Behera
rossella ladogana 6rossella ladogana 6
Thanks Swaraj but this problem effects the Force.com IDE tool. The error is showed here.
User-added image
Even if the code is correct, what can be the cause?

Thanks

Rossella
Aana Seals 6Aana Seals 6
Hello Rossella, I am having the same issue.  Did you ever figure out how to resolve it?
Thanks,
Aana
Joel BurtramJoel Burtram
I have the same issues and there is not much help on the forums or SE.  I have serious doubts about this Force.Com IDE plugin (Eclipse v4.6.2 Force.com v37) - it's nearly unusable for development of any kind.  The editor lacks many common Eclipse features and the code completion is horrendous.  I've been writing code for 15 years, but this is my first foray into SalesForce development.  The platform seems to relatively straightforward but the tooling is awful.  I follow the quickstarts and trailheads, but nothing seems to work as described.  This Force.com IDE is a major disappointment.  If anyone knows of a good tutorial on how to get this plugin to work effectively, PLEASE post it.
Deepak Pandey 13Deepak Pandey 13
insert this ContainsProva prova1 = new ContainsProva(); after you call the method and class...
phani kumar 95phani kumar 95
I've got into the same issue. however, in the eclipse warnings: i found that the classes are not saved to server and i've right clicked the test and other classes and said save to server. and then im able to get rid of this.
David Roberts 4David Roberts 4
I had the same with a trigger test class. Tried saving the trigger and test class but didn't fix it.
I then turned on the debug log and it ran.
Michiel van FeliusMichiel van Felius
I've had the same issue. It was fixed by saving the project to the server (thx phani kumar 95) and then editing and saving (Apply) the apex test configuration.
Imran LatifImran Latif
Thanks to Kumar. I tried to save to Server or Synchronize with server then I start seeing error in my code. I fixed errors and issue is resolved.
Obinna Johnphill 25Obinna Johnphill 25
Thanks phani kumar 95, I saved project to server and test now runs without any issues. Well appreciated! :)