Avatar of gudii9
gudii9
Flag for United States of America asked on

assert statement in junit for Map object

@RunWith(SpringJUnit4ClassRunner.class)

@ContextConfiguration(classes=DifConfig.class, loader=AnnotationConfigContextLoader.class)
public class TestVendor {

	private Logger logger=Logger.getLogger(VendorService.class);

	@Inject
	transient private VendorService vendorService;
	@Test
	public void testVendorList() {

		Map<String, String> vendorList = vendorService.getVendorList();
		
	}
            

Open in new window



>>Map<String, String> vendorList = vendorService.getVendorList();


what kind of Assert statment i can write around above map object(vendorList ) which comes as result of get method call(getVendorList) on business service class(vendorService)

please advise
Any links resources ideas highly appreciated. Thanks in advance
Java EEJava

Avatar of undefined
Last Comment
gudii9

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
mccarl

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
gudii9

ASKER
Let us assume VendorService just has vendor information like VendorName, VendorNumber,VendorAddress, VendorPhone.
when some one search on Vendor number we can display that in search page
gudii9

ASKER
please advise
mccarl

What *exactly* is in the Map  vendorList after this line of code?
Map<String, String> vendorList = vendorService.getVendorList();

Open in new window

This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
gudii9

ASKER
i just made up above test  case. I do not have anything after that line. Can we assume some kind of vedor details itself in the map? please advise
gudii9

ASKER
What *exactly* is in the Map  vendorList after this line of code?

Open in new window


Are you expecting like what kind of vendor information like phone number, address or middle name etc details. Can you please advise
gudii9

ASKER
Please advise
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
mccarl

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
gudii9

ASKER
I do not have actual map object since i just assumed this map myself. Is there is a way you can point to some link which discusses on writing assert statement on some sample map object. please advise