Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assert cannot be resolved

Tags:

java

Description:"Assert cannot be resolved"
Resource :ConsumerAccountProfileAssertion.java
Path : /SCACCWSTest/src/test/java/ford/cucumber/cap/assertion
Location : line 81
Type :Java Problem Assert cannot be resolved
Eclipse OxygenWas

for(String outputFieldToBeVerified : outputFieldsToBeVerified) {
            switch (CommonUtils.trimAndConvertToUpperCase(outputFieldToBeVerified)) {
                case CommonConstants.OUTPUT_FIELD_CONSUMER_ID:
                    consumerBOFromDB = ConsumerAccountProfileDAO.getPartialName(consumerID);
                    Assert.assertTrue(consumerID!=null && consumerID.equals(consumerBOFromDB.getConsumerID()));
                    //10002224452,10007356852,"10013131152",consumerBOFromDB
                break;
like image 663
karthikchowdary Avatar asked Oct 16 '22 17:10

karthikchowdary


2 Answers

If you intend to use JUnit, you'll need to import org.junit.Assert; and make sure you have JUnit in your classpath (see here for Eclipse Oxygen release). Or whatever assertion library.

like image 128
Will Avatar answered Oct 21 '22 03:10

Will


In eclipse, importing the below package will resolve the issue(jUnit 5)

import org.junit.Assert;
like image 31
Ashu Singh Avatar answered Oct 21 '22 05:10

Ashu Singh