I want to write JUnit test classes for a project involving login, creation, updation & deletion of various custom objects, fields, tabs, custom settings, etc. most of them utilizing metadata API calls.

Can anyone suggest me how to write JUnit test cases in java (eclipse) for the same.? because it seems there must be a good practice which involves invocation of Salesforce webservices (As in Apex we are not allowed to make callouts) and want to follow the same using Java.

Like we may skip a particular line of code in Apex using Test.isRunningTest() method. I'm new to Java test case writing.

  • Can you clarify your situation? Are you trying to test a library of Java code that builds logic on top of the raw Salesforce API calls? Or are you trying to assert the behaviour of the raw APIs when called through just the WSDL generated code? – Keith C Sep 17 '14 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.