You need to sign in to do that
Don't have an account?
Bob 11
Test Class Error System.QueryException: List has no rows for assignment to SObject
I made an update to a apex test class but when i try to deploy it give me the following error. I'm not sure how to fix this
System.QueryException: List has no rows for assignment to SObject
Stack Trace: Class.advic_fsl_AppointmentBooking.scheduleServiceAppointment: line 71, column 1 Class.advic_fsl_AppointmentBookingTest.testScheduleServiceAppointment: line 146, column 1
here is the test class below. i will post the apex class too
System.QueryException: List has no rows for assignment to SObject
Stack Trace: Class.advic_fsl_AppointmentBooking.scheduleServiceAppointment: line 71, column 1 Class.advic_fsl_AppointmentBookingTest.testScheduleServiceAppointment: line 146, column 1
here is the test class below. i will post the apex class too
@isTest private class advic_fsl_AppointmentBookingTest { @testSetup static void setup() { // Create test data // Create Scheduling Policy FSL__Scheduling_Policy__c schedulingPolicy = new FSL__Scheduling_Policy__c(FSL__Commit_Mode__c='AlwaysCommit', FSL__Fix_Overlaps__c=false, FSL__Daily_Optimization__c=false, Name='Customer First', FSL__Travel_Mode__c=false); insert schedulingPolicy; // Create Operating Hours OperatingHours operatingHours = new OperatingHours(Description='Testing Hours', Name='Energy Assessment Calendar', TimeZone='America/New_York'); insert operatingHours; // Create Time Slots List<TimeSlot> timeSlots = new List<TimeSlot>(); timeSlots.add(new TimeSlot(DayOfWeek='Monday', Type='Normal', OperatingHoursId=operatingHours.Id, StartTime=Time.newInstance(10,0,0,0), EndTime=Time.newInstance(12,0,0,0))); timeSlots.add(new TimeSlot(DayOfWeek='Tuesday', Type='Normal', OperatingHoursId=operatingHours.Id, StartTime=Time.newInstance(10,0,0,0), EndTime=Time.newInstance(12,0,0,0))); insert timeSlots; Account testAccount = new Account(Name='Test Account', Customer_Eligible__c=true); insert testAccount; Contact testContact = new Contact(AccountId=testAccount.Id, LastName='TestContact'); insert testContact; Profile riseCommunityCustomerProfile = [SELECT Id FROM Profile WHERE Name='RISE Community Customer User']; User runningUser = new User(Alias = 'standt', Email='standarduser@testorg.com', EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', LocaleSidKey='en_US', ProfileId = riseCommunityCustomerProfile.Id, TimeZoneSidKey='America/New_York', UserName='standarduser@testorg.com', ContactId=testContact.Id); insert runningUser; WorkType eaIh = new WorkType(); eaIh.Name = 'Energy Assessment - In Home'; eaIh.EstimatedDuration = 90.0; insert eaIh; } static testMethod void testCreateWorkOrderAndServiceAppointment() { Account account = [SELECT Id FROM Account WHERE Customer_Eligible__c = true LIMIT 1]; Contact contact = [SELECT Id FROM Contact WHERE AccountId =: account.Id]; User runningUser = [SELECT Id FROM User WHERE ContactId =: contact.Id]; List<WorkOrder> insertedWorkOrders = [SELECT AccountId, ContactId FROM WorkOrder]; List<ServiceAppointment> insertedServiceAppointments = [SELECT AccountId, ContactId, ParentRecordId, EarliestStartTime, DueDate FROM ServiceAppointment ]; if(insertedWorkOrders.size() == 1) { WorkOrder insertedWorkOrder = insertedWorkOrders[0]; System.assertEquals(account.Id, insertedWorkOrder.AccountId, 'The Work Order AccountId was not assigned.'); System.assertEquals(contact.Id, insertedWorkOrder.ContactId, 'The Work Order ContactId was not assigned.'); if(insertedServiceAppointments.size() == 1) { ServiceAppointment insertServiceAppointment = insertedServiceAppointments[0]; System.assertEquals(account.Id, insertServiceAppointment.AccountId, 'The Service Appointment AccountId was not assigned.'); System.assertEquals(contact.Id, insertServiceAppointment.ContactId, 'The Service Appointment ContactId was not assigned.'); System.assertEquals(insertedWorkOrder.Id, insertServiceAppointment.ParentRecordId, 'The Work Order that was inserted was not assigned to the inserted Service Appointment.'); System.assert(insertServiceAppointment.EarliestStartTime != null, 'The Service Appointment EarliestStartTime was not populated.'); System.assert(insertServiceAppointment.DueDate != null, 'The Service Appointment DueDate was not populated.'); } } } static testMethod void testGetAppointmentSlots() { Account account = [SELECT Id FROM Account WHERE Customer_Eligible__c = true LIMIT 1]; Contact contact = [SELECT Id FROM Contact WHERE AccountId =: account.Id]; User runningUser = [SELECT AccountId, ContactId FROM User WHERE ContactId =: contact.Id]; WorkOrder testWorkOrder = new WorkOrder(AccountId=runningUser.AccountId, ContactId=runningUser.ContactId); insert testWorkOrder; ServiceAppointment testServiceAppointment = new ServiceAppointment(ContactId=runningUser.ContactId, ParentRecordId=testWorkOrder.Id, EarliestStartTime=Datetime.now(), DueDate=Datetime.now().addMonths(1)); insert testServiceAppointment; Test.startTest(); advic_fsl_AppointmentBooking.CmpData data = advic_fsl_AppointmentBooking.getAppointmentSlots(testWorkOrder.Id, testServiceAppointment.Id); Test.stopTest(); // Letting the managed package tests control the FSL methods and test them. // The method itself is covered in the FSL managed package tests. } static testMethod void testUndeleteWorkOrderAndServiceAppointment() { Account account = [SELECT Id FROM Account WHERE Customer_Eligible__c = true LIMIT 1]; Contact contact = [SELECT Id FROM Contact WHERE AccountId =: account.Id]; User runningUser = [SELECT AccountId, ContactId FROM User WHERE ContactId =: contact.Id]; WorkOrder testWorkOrder = new WorkOrder(AccountId=runningUser.AccountId, ContactId=runningUser.ContactId); insert testWorkOrder; ServiceAppointment testServiceAppointment = new ServiceAppointment(ContactId=runningUser.ContactId, ParentRecordId=testWorkOrder.Id, EarliestStartTime=Datetime.now(), DueDate=Datetime.now().addMonths(1)); insert testServiceAppointment; delete testWorkOrder; Test.startTest(); advic_fsl_AppointmentBooking.undeleteWorkOrderAndServiceAppointment(testWorkOrder.Id, testServiceAppointment.Id); Test.stopTest(); System.assertEquals(1, [SELECT Id FROM WorkOrder WHERE Id =: testWorkOrder.Id].size(), 'The Work Order was not undeleted.'); System.assertEquals(1, [SELECT Id FROM ServiceAppointment WHERE Id =: testServiceAppointment.Id].size(), 'The Service Appointment was not undeleted'); } static testMethod void testUpdateServiceAppointment() { Account account = [SELECT Id FROM Account WHERE Customer_Eligible__c = true LIMIT 1]; Contact contact = [SELECT Id FROM Contact WHERE AccountId =: account.Id]; User runningUser = [SELECT AccountId, ContactId FROM User WHERE ContactId =: contact.Id]; WorkOrder testWorkOrder = new WorkOrder(AccountId=runningUser.AccountId, ContactId=runningUser.ContactId); insert testWorkOrder; ServiceAppointment testServiceAppointment = new ServiceAppointment(ContactId=runningUser.ContactId, ParentRecordId=testWorkOrder.Id, EarliestStartTime=Datetime.now(), DueDate=Datetime.now().addMonths(1)); insert testServiceAppointment; String slotJSON = '{"grade":100,"times":{"endDT":"2020-06-02T15:00:00.000Z","startDT":"2020-06-02T13:00:00.000Z"}}'; System.runAs(runningUser) { Test.startTest(); advic_fsl_AppointmentBooking.updateServiceAppointment(slotJSON, testServiceAppointment.Id, 'abc', 'xyz'); Test.stopTest(); } ServiceAppointment serviceAppointment = [SELECT ArrivalWindowStartTime, ArrivalWindowEndTime FROM ServiceAppointment WHERE Id =: testServiceAppointment.Id]; DateTime arrivalWindowStartTime = (DateTime)json.deserialize('"2020-06-02T13:00:00.000Z"', datetime.class); DateTime arrivalWindowEndTime = (DateTime)json.deserialize('"2020-06-02T15:00:00.000Z"', datetime.class); //System.assertEquals(arrivalWindowStartTime, serviceAppointment.ArrivalWindowStartTime, 'The Service Appointment ArrivalWindowStartTime is incorrect.'); //System.assertEquals(arrivalWindowEndTime, serviceAppointment.ArrivalWindowEndTime, 'The Service Appointment ArrivalWindowEndTime is incorrect.'); } static testMethod void testScheduleServiceAppointment() { Account account = [SELECT Id FROM Account WHERE Customer_Eligible__c = true LIMIT 1]; Contact contact = [SELECT Id FROM Contact WHERE AccountId =: account.Id]; User runningUser = [SELECT AccountId, ContactId FROM User WHERE ContactId =: contact.Id]; WorkOrder testWorkOrder = new WorkOrder(AccountId=runningUser.AccountId, ContactId=runningUser.ContactId); insert testWorkOrder; ServiceAppointment testServiceAppointment = new ServiceAppointment(ContactId=runningUser.ContactId, ParentRecordId=testWorkOrder.Id, EarliestStartTime=Datetime.now(), DueDate=Datetime.now().addMonths(1), ArrivalWindowStartTime=Datetime.now(), ArrivalWindowEndTime=Datetime.now().addMonths(1), Status = 'Scheduled'); insert testServiceAppointment; Test.startTest(); advic_fsl_AppointmentBooking.scheduleServiceAppointment(testServiceAppointment.Id); Test.stopTest(); // Letting the managed package tests control the FSL methods and test them. // The method itself is covered in the FSL managed package tests. } static testMethod void testCheckAccountEligibility_NoAccounts() { Account account = [SELECT Id FROM Account WHERE Customer_Eligible__c = true LIMIT 1]; Contact contact = [SELECT Id FROM Contact WHERE AccountId =: account.Id]; User runningUser = [SELECT AccountId, ContactId FROM User WHERE ContactId =: contact.Id]; account.Eligible_Testing__c = false; account.Ineligible_Reason_Code__c = 'DISC'; account.Square_Footage__c = ''; account.Building_Type__c = 'Single-Family Home'; contact.Part_of_Condo_Association__c = 'No'; update account; update contact; String eligibilityStatus = ''; System.runAs(runningUser) { Test.startTest(); eligibilityStatus = advic_fsl_AppointmentBooking.checkAccountEligibility(); Test.stopTest(); } System.assertEquals('Due to your utility service rate code, we are not able to service your property. Please contact your local Community Action Partnership, or call our offices for more information. For National Grid Rhode Island customers dial 888-633-7947. For National Grid Cape Cod or Cape Light Compact customers dial 774-352-1022. For Eversource, Liberty or Unitil customers dial 339-502-6335. Thank you.', eligibilityStatus, 'The Account should be ineligible.'); } static testMethod void testCheckAccountEligibility_NoAccounts1() { Account account = [SELECT Id FROM Account WHERE Customer_Eligible__c = true LIMIT 1]; Contact contact = [SELECT Id FROM Contact WHERE AccountId =: account.Id]; User runningUser = [SELECT AccountId, ContactId FROM User WHERE ContactId =: contact.Id]; account.Eligible_Testing__c = false; account.Ineligible_Reason_Code__c = 'COM'; account.Square_Footage__c = ''; account.Building_Type__c = 'Single-Family Home'; contact.Part_of_Condo_Association__c = 'No'; update account; update contact; String eligibilityStatus = ''; System.runAs(runningUser) { Test.startTest(); eligibilityStatus = advic_fsl_AppointmentBooking.checkAccountEligibility(); Test.stopTest(); } System.assertEquals('Due to the commercial rate code on this property, we are not able to schedule a residential No-Cost Energy Assessment. Please contact out office for further assistance at 401-784-3700.', eligibilityStatus, 'The Account should be ineligible.'); } static testMethod void testCheckAccountEligibility_NoAccounts2() { Account account = [SELECT Id FROM Account WHERE Customer_Eligible__c = true LIMIT 1]; Contact contact = [SELECT Id FROM Contact WHERE AccountId =: account.Id]; User runningUser = [SELECT AccountId, ContactId FROM User WHERE ContactId =: contact.Id]; account.Eligible_Testing__c = false; account.Ineligible_Reason_Code__c = 'PP'; account.Square_Footage__c = ''; account.Building_Type__c = 'Single-Family Home'; contact.Part_of_Condo_Association__c = 'No'; update account; update contact; String eligibilityStatus = ''; System.runAs(runningUser) { Test.startTest(); eligibilityStatus = advic_fsl_AppointmentBooking.checkAccountEligibility(); Test.stopTest(); } System.assertEquals('We are not able to schedule you a No-Cost energy assessment due to the recent participation in the program. For further assistance, please contact our offices. For National Grid Rhode Island customers dial 888-633-7947. For National Grid Cape Cod or Cape Light Compact customers dial 774-352-1022. For Eversource, Liberty or Unitil customers dial 339-502-6335. Thank you.', eligibilityStatus, 'The Account should be ineligible.'); } static testMethod void testCheckAccountEligibility_NoAccounts3() { Account account = [SELECT Id FROM Account WHERE Customer_Eligible__c = true LIMIT 1]; Contact contact = [SELECT Id FROM Contact WHERE AccountId =: account.Id]; User runningUser = [SELECT AccountId, ContactId FROM User WHERE ContactId =: contact.Id]; account.Eligible_Testing__c = false; account.Ineligible_Reason_Code__c = 'AMA'; account.Square_Footage__c = ''; account.Building_Type__c = 'Single-Family Home'; contact.Part_of_Condo_Association__c = 'No'; update account; update contact; String eligibilityStatus = ''; System.runAs(runningUser) { Test.startTest(); eligibilityStatus = advic_fsl_AppointmentBooking.checkAccountEligibility(); Test.stopTest(); } System.assertEquals('Thank you for your inquiry, we are unable to complete your request at this time. For further assistance, please contact our offices. For National Grid Rhode Island customers dial 888-633-7947. For National Grid Cape Cod or Cape Light Compact customers dial 774-352-1022. For Eversource, Liberty or Unitil customers dial 339-502-6335.', eligibilityStatus, 'The Account should be ineligible.'); } static testMethod void testCheckAccountEligibility_GasAccountEligible() { Account account = [SELECT Id, Utility_Number__c, Eligible_Testing__c, Ineligible_Reason_Code__c FROM Account WHERE Customer_Eligible__c = true LIMIT 1]; Contact contact = [SELECT Id, Gas_Utility_Number__c, How_do_you_heat_your_home__c FROM Contact WHERE AccountId =: account.Id]; User runningUser = [SELECT AccountId, ContactId FROM User WHERE ContactId =: contact.Id]; account.Utility_Number__c = '14356'; account.Eligible_Testing__c = true; account.Building_Type__c = 'Single-Family Home'; account.Square_Footage__c = '2000-3000 sq ft'; update account; contact.Gas_Utility_Number__c = '14356'; contact.How_do_you_heat_your_home__c = 'Natural Gas'; contact.Part_of_Condo_Association__c = 'No'; update contact; String eligibilityStatus = ''; System.runAs(runningUser) { Test.startTest(); eligibilityStatus = advic_fsl_AppointmentBooking.checkAccountEligibility(); Test.stopTest(); } System.assertEquals('Eligible', eligibilityStatus, 'The Contact should be eligible.'); } static testMethod void testCheckAccountEligibility_GasAccountIneligible() { Account account = [SELECT Id, Utility_Number__c, Eligible_Testing__c, Ineligible_Reason_Code__c FROM Account WHERE Customer_Eligible__c = true LIMIT 1]; Contact contact = [SELECT Id, Gas_Utility_Number__c, How_do_you_heat_your_home__c FROM Contact WHERE AccountId =: account.Id]; User runningUser = [SELECT AccountId, ContactId FROM User WHERE ContactId =: contact.Id]; account.Utility_Number__c = '14356'; account.Ineligible_Reason_Code__c = 'DISC'; update account; contact.Gas_Utility_Number__c = '14356'; contact.How_do_you_heat_your_home__c = 'Natural Gas'; update contact; String eligibilityStatus = ''; System.runAs(runningUser) { Test.startTest(); eligibilityStatus = advic_fsl_AppointmentBooking.checkAccountEligibility(); Test.stopTest(); } System.assertEquals('Due to your utility service rate code, we are not able to service your property. Please contact your local Community Action Partnership, or call our offices for more information. For National Grid Rhode Island customers dial 888-633-7947. For National Grid Cape Cod or Cape Light Compact customers dial 774-352-1022. For Eversource, Liberty or Unitil customers dial 339-502-6335. Thank you.', eligibilityStatus, 'The General Error message should have returned.'); } static testMethod void testCheckAccountEligibility_GasAccountIneligible1() { Account account = [SELECT Id, Utility_Number__c, Eligible_Testing__c, Ineligible_Reason_Code__c FROM Account WHERE Customer_Eligible__c = true LIMIT 1]; Contact contact = [SELECT Id, Gas_Utility_Number__c, How_do_you_heat_your_home__c FROM Contact WHERE AccountId =: account.Id]; User runningUser = [SELECT AccountId, ContactId FROM User WHERE ContactId =: contact.Id]; account.Utility_Number__c = '14356'; account.Ineligible_Reason_Code__c = 'COM'; update account; contact.Gas_Utility_Number__c = '14356'; contact.How_do_you_heat_your_home__c = 'Natural Gas'; update contact; String eligibilityStatus = ''; System.runAs(runningUser) { Test.startTest(); eligibilityStatus = advic_fsl_AppointmentBooking.checkAccountEligibility(); Test.stopTest(); } System.assertEquals('Due to the commercial rate code on this property, we are not able to schedule a residential No-Cost Energy Assessment. Please contact out office for further assistance at 401-784-3700.', eligibilityStatus, 'The General Error message should have returned.'); } static testMethod void testCheckAccountEligibility_GasAccountIneligible2() { Account account = [SELECT Id, Utility_Number__c, Eligible_Testing__c, Ineligible_Reason_Code__c FROM Account WHERE Customer_Eligible__c = true LIMIT 1]; Contact contact = [SELECT Id, Gas_Utility_Number__c, How_do_you_heat_your_home__c FROM Contact WHERE AccountId =: account.Id]; User runningUser = [SELECT AccountId, ContactId FROM User WHERE ContactId =: contact.Id]; account.Utility_Number__c = '14356'; account.Ineligible_Reason_Code__c = 'PP'; update account; contact.Gas_Utility_Number__c = '14356'; contact.How_do_you_heat_your_home__c = 'Natural Gas'; update contact; String eligibilityStatus = ''; System.runAs(runningUser) { Test.startTest(); eligibilityStatus = advic_fsl_AppointmentBooking.checkAccountEligibility(); Test.stopTest(); } System.assertEquals('We are not able to schedule you a No-Cost energy assessment due to the recent participation in the program. For further assistance, please contact our offices. For National Grid Rhode Island customers dial 888-633-7947. For National Grid Cape Cod or Cape Light Compact customers dial 774-352-1022. For Eversource, Liberty or Unitil customers dial 339-502-6335. Thank you.', eligibilityStatus, 'The Contact should be eligible.'); } static testMethod void testCheckAccountEligibility_GasAccountIneligible3() { Account account = [SELECT Id, Utility_Number__c, Eligible_Testing__c, Ineligible_Reason_Code__c FROM Account WHERE Customer_Eligible__c = true LIMIT 1]; Contact contact = [SELECT Id, Gas_Utility_Number__c, How_do_you_heat_your_home__c FROM Contact WHERE AccountId =: account.Id]; User runningUser = [SELECT AccountId, ContactId FROM User WHERE ContactId =: contact.Id]; account.Utility_Number__c = '14356'; account.Ineligible_Reason_Code__c = 'AMA'; update account; contact.Gas_Utility_Number__c = '14356'; contact.How_do_you_heat_your_home__c = 'Natural Gas'; update contact; String eligibilityStatus = ''; System.runAs(runningUser) { Test.startTest(); eligibilityStatus = advic_fsl_AppointmentBooking.checkAccountEligibility(); Test.stopTest(); } System.assertEquals('Thank you for your inquiry, we are unable to complete your request at this time. For further assistance, please contact our offices. For National Grid Rhode Island customers dial 888-633-7947. For National Grid Cape Cod or Cape Light Compact customers dial 774-352-1022. For Eversource, Liberty or Unitil customers dial 339-502-6335.', eligibilityStatus, 'The Contact should be eligible.'); } static testMethod void testCheckAccountEligibility_ElectricAccountIneligibleq1() { Account account = [SELECT Id, Utility_Number__c, Eligible_Testing__c, Ineligible_Reason_Code__c FROM Account WHERE Customer_Eligible__c = true LIMIT 1]; Contact contact = [SELECT Id, Electric_Utility_Number__c, How_do_you_heat_your_home__c FROM Contact WHERE AccountId =: account.Id]; User runningUser = [SELECT AccountId, ContactId FROM User WHERE ContactId =: contact.Id]; account.Utility_Number__c = '14356'; account.Eligible_Testing__c = false; account.Ineligible_Reason_Code__c = 'COM'; update account; contact.Electric_Utility_Number__c = '14356'; contact.How_do_you_heat_your_home__c = 'Electric'; update contact; } static testMethod void testCheckAccountEligibility_ElectricAccountIneligible2() { Account account = [SELECT Id, Utility_Number__c, Eligible_Testing__c, Ineligible_Reason_Code__c FROM Account WHERE Customer_Eligible__c = true LIMIT 1]; Contact contact = [SELECT Id, Electric_Utility_Number__c, How_do_you_heat_your_home__c FROM Contact WHERE AccountId =: account.Id]; User runningUser = [SELECT AccountId, ContactId FROM User WHERE ContactId =: contact.Id]; account.Utility_Number__c = '14356'; account.Eligible_Testing__c = false; account.Ineligible_Reason_Code__c = 'PP'; update account; contact.Electric_Utility_Number__c = '14356'; contact.How_do_you_heat_your_home__c = 'Electric'; update contact; } static testMethod void testCheckAccountEligibility_ElectricAccountIneligible3() { Account account = [SELECT Id, Utility_Number__c, Eligible_Testing__c, Ineligible_Reason_Code__c FROM Account WHERE Customer_Eligible__c = true LIMIT 1]; Contact contact = [SELECT Id, Electric_Utility_Number__c, How_do_you_heat_your_home__c FROM Contact WHERE AccountId =: account.Id]; User runningUser = [SELECT AccountId, ContactId FROM User WHERE ContactId =: contact.Id]; account.Utility_Number__c = '14356'; account.Eligible_Testing__c = false; account.Ineligible_Reason_Code__c = 'AMA'; update account; contact.Electric_Utility_Number__c = '14356'; contact.How_do_you_heat_your_home__c = 'Electric'; update contact; } }
Can you try changing the Apex class little as below. There will be no change in functionality just best pratice. I have highlited the change.
Please find the below article (https://help.salesforce.com/s/articleView?id=000328824&type=1) for the same.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
All Answers
Can you try changing the Apex class little as below. There will be no change in functionality just best pratice. I have highlited the change.
Please find the below article (https://help.salesforce.com/s/articleView?id=000328824&type=1) for the same.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
Just simple
Please add below line in your test class:-
Method name:- testScheduleServiceAppointment
add below line on Line number 138 in your test class and save and run your test class
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
I am getting the below error when i updated my class
Hi Mukesh,
I will try adding your code to my test class and recieved these errors below
Can you remove Public access modifier in line 72 and try to save it.
Thanks,
I updated that ection of code like this, but it is giving more errors when i try to deploy to production
@AuraEnabled
public static void scheduleServiceAppointment(Id serviceAppointmentId) {
Id schedulingPolicyId;
List<FSL__Scheduling_Policy__c> schlist= new List<FSL__Scheduling_Policy__c>();
schlist=[SELECT Id, Name FROM FSL__Scheduling_Policy__c WHERE Name = 'New Scheduling Policy' LIMIT 1];
if(schlist.size()<0)
{
schedulingPolicyId = schlist[0].Id;
}
Can you share what are those error. Are you getting error on the same line again?
Did your test class ran succesfully in developer console?
Thanks,
here are the errors below. The test class did run successfully in my sandbox console and in the production console. I'm not sur eif i have the code right where i removed the public access method
The screenshot which you shared is not much clear . Check those lines in test class and change the assertion values accordingly.
This should resolve the issue and mainly the issue which you reported is resolved and this is issue with your test class implementation and data and you have to change the assertion values based on it.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
System.QueryException: List has no rows for assignment to SObject
Stack Trace: Class.advic_fsl_AppointmentBooking.getSlots: line 302, column 1 Class.advic_fsl_AppointmentBooking.getAppointmentSlots: line 21, column 1 Class.advic_fsl_AppointmentBookingTest.testGetAppointmentSlots: line 80, column 1
System.QueryException: List has no rows for assignment to SObject
Stack Trace: Class.advic_fsl_AppointmentBookingTest.testScheduleServiceAppointment: line 139, column 1