junit testing

Hi,

I followed

https://www.youtube.com/watch?v=v2F49zLLj-8

package test;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

@RunWith(Suite.class)
@SuiteClasses({ ConcateTest.class, MultiplyTest.class })
public class AllTests {

}

Open in new window


package test;

import static org.junit.Assert.*;

import org.junit.Test;

public class ConcateTest {

	@Test
	public void testConcat() {
		Junit junit=new Junit();
		String result=junit.concatenate("aa", "bc");
		assertEquals("aabc", result);
		
		
	}

}

Open in new window


package test;

public class Junit {

	public String concatenate(String one, String two)
	{

	return one+two;

	}

	public int multiply(int number1, int number2)
	{

	return number1*number2;
	}

	}

Open in new window


package test;

import static org.junit.Assert.*;

import org.junit.Test;

public class MultiplyTest {

	@Test
	public void testMultiply() {
		Junit junit=new Junit();
		int result=junit.multiply(3, 6);
		assertEquals(18, result);
	}

}

Open in new window


i wrote above junit tests, suite all works perfect with simple int and strings. When it comes to unit testing complex objects in real time projects involving multiple layers, services with mock objects i am not completely confident in those scenarios. Are there any good similar video tutorials on those advanced junit topics. Any good material, resources to go learn practically step by step. Please advise
LVL 7
gudii9Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gudii9Author Commented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.