Questions tagged [failing-tests]

A unit test is code that is written and executed to test a specific portion/unit of source code. Tests that do not pass are considered failing. Tests that do not generate desired coverage are still considered to pass.

Filter by
Sorted by
Tagged with
0
votes
1answer
146 views

Test failing for Apex Trigger

I'm trying to cover my Apex Trigger below using a Test Class: trigger createPubAppovalCase on Opportunity (after update) { List<Case> listcase = new List<Case>(); for(Opportunity ...
4
votes
2answers
4k views

Test code for the new standard Order object

The last line insert ordPd causes exception: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Price Book Not Set on Order: [] All lines before the ...
9
votes
1answer
306 views

How to set both onInstall and seeAllData to true for a test method

I tried to set SeeAllData = true for the test method with OnInstall = true. But I was not able to save the test class if I use "@isTest(OnInstall=true,SeeAllData=true)", so I saved it with "@isTest(...
1
vote
0answers
729 views

Can you ignore test failures when installing an unmanaged package?

I want to install an unmanaged package in our production environment but I know that a couple of tests will fail due to settings specific to our org. I would like to be able to install it and then ...
4
votes
2answers
3k views

INACTIVE_OWNER_OR_USER

I'm getting an error INACTIVE_OWNER_OR_USER, operation performed with inactive user, and I have been doing a lot of research and the cause that I have found for this is its attempting to assign a my ...
6
votes
1answer
13k views

Assign a case to a queue in Apex (Test class)

I'm sure this must be quite possible, and probably easy. I need to create a test method in which part of the scenario is that for when a Case is assigned to a Queue. I have successfully tested all my ...
1
vote
1answer
2k views

Apex Test not updating parent object field based on child object formula fields

I have a before insert, before update trigger that updates a value in a parent object when a new child object is inserted or updated. The child object contains loads of checkboxes which are used by ...
3
votes
2answers
466 views

Testing batch apex question

I'm working on a batch job that will change a lead record's Owner when the record was created over 15 minutes ago and is still owned by a particular user. Here's the batch job. This works in ...
1
vote
4answers
2k views

Test class: Assertion Failed

I m trying to cover and test my apex code so I developped a test class to test my insertion, my the test is failed unfortulately; and gave me this error: Assertion error here is my test class: @...
0
votes
1answer
67 views

Trigger Test Method stuck at 18% coverage

I've been working on this all night, so this post is my last resort. I have a trigger that creates a Chatter post when an Opportunity is "Closed Won," giving details of the sale. I thought I had ...
0
votes
2answers
1k views

Validation Rule Causing Deployment Issue

I'm trying to deploy a few items to production. I tested all my classes/triggers and they are all at 90% or higher. Unfortunately, there is a class a consultant had written before I was here that is ...
3
votes
1answer
198 views

apex test class

Pretty straight forward question: is it possible to run tests without using the Developer Console? I've reached my 5,000 max API Calls and I don't want to wait till' tomorrow to be able to keep ...
0
votes
1answer
652 views

Test method not passing for duplicate trigger which checks for duplicate email (error : System.AssertException: Assertion Failed)

hi this is my trigger to test duplicate between two email address which is working fine and also it allows duplicate if the checkbox "allow_duplicate__c" is selected, but there is a problem with test ...
16
votes
4answers
7k views

How to handle installed Managed Packages failing tests?

I have several AppExchange apps installed that are failing tests. What is the recommended approach to resolving this? Are tests run when a new package is installed? Is there a way to determine what is ...
2
votes
1answer
1k views

How can tests fail in production?

This question is connected to my previous question here: User with read only profile updates records We have a test case that started failing recently. It is also failing in production. As far as I ...