function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
cactusdavecactusdave 

Writing Test Class for String Declarations

We were supplied a class by a vendor that works successfully on our sandbox. This was created by generating the WSDL.  I am having all sorts of trouble sending this to production as this dramatically drops our code coverage.  The bulk of the class is just defining variables. 

 

Is there a way that anyone has come across to test these string declarations? 

 

If this helps, this is called by another class that sends the information to web service. Obviously, the other class that calls this fails as well.

 

// THIS IS THE CLASS
public class webserviceEvo {
    public class updateTaskByCaptureId_element {
        public String captureId;
        public String channel;
        public String category;
        public DateTime activationDateTime;
        public DateTime dueDateTime;
        public DateTime expirationDateTime;
        public DateTime reprioritizeDateTime;
        public Integer businessValue;
        public Integer priority;
        public brokerGtlEvo.TaskExt ext;
        public webserviceCaptureGtlEvo.string2stringMap data;
        public String reason;
        public String actor;
        private String[] captureId_type_info = new String[]{'captureId','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] channel_type_info = new String[]{'channel','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] category_type_info = new String[]{'category','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] activationDateTime_type_info = new String[]{'activationDateTime','http://www.w3.org/2001/XMLSchema','dateTime','1','1','true'};
        private String[] dueDateTime_type_info = new String[]{'dueDateTime','http://www.w3.org/2001/XMLSchema','dateTime','1','1','true'};
        private String[] expirationDateTime_type_info = new String[]{'expirationDateTime','http://www.w3.org/2001/XMLSchema','dateTime','1','1','true'};
        private String[] reprioritizeDateTime_type_info = new String[]{'reprioritizeDateTime','http://www.w3.org/2001/XMLSchema','dateTime','1','1','true'};
        private String[] businessValue_type_info = new String[]{'businessValue','http://www.w3.org/2001/XMLSchema','int','1','1','true'};
        private String[] priority_type_info = new String[]{'priority','http://www.w3.org/2001/XMLSchema','int','1','1','true'};
        private String[] ext_type_info = new String[]{'ext','http://broker.gtl.evo','TaskExt','1','1','true'};
        private String[] data_type_info = new String[]{'data','http://webservice.capture.gtl.evo','string2stringMap','1','1','true'};
        private String[] reason_type_info = new String[]{'reason','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] actor_type_info = new String[]{'actor','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://webservice.capture.gtl.evo','true','true'};
        private String[] field_order_type_info = new String[]{'captureId','channel','category','activationDateTime','dueDateTime','expirationDateTime','reprioritizeDateTime','businessValue','priority','ext','data','reason','actor'};
    }
    
 public class completeTaskByBrokerId_element {
        public Long brokerId;
        public String reason;
        public String actor;
        public DateTime completedDateTime;
        private String[] brokerId_type_info = new String[]{'brokerId','http://www.w3.org/2001/XMLSchema','long','1','1','true'};
        private String[] reason_type_info = new String[]{'reason','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] actor_type_info = new String[]{'actor','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] completedDateTime_type_info = new String[]{'completedDateTime','http://www.w3.org/2001/XMLSchema','dateTime','1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://webservice.capture.gtl.evo','true','true'};
        private String[] field_order_type_info = new String[]{'brokerId','reason','actor','completedDateTime'};
    }

 

*werewolf**werewolf*

I would think just instantiating the class (i.e. webserviceEvo something = new webserviceEvo() ) in your test class should make all of those lines covered by test.

*werewolf**werewolf*

Or actually instantiating the subclass, updateTaskByCaptureId_element.  Although I seem to remember another thread on this a year ago about how there was a bug in test coverage on this stuff, but try just instantiating your subclasses directly in your test methods and see if that fixes it.