Complete the code to create an integration test method that checks if two components interact correctly.
public void testComponentInteraction() {
ComponentA a = new ComponentA();
ComponentB b = new ComponentB();
a.setDependency([1]);
boolean result = a.performAction();
assertTrue(result);
}The integration test verifies interaction by injecting ComponentB into ComponentA as a dependency.
Complete the code to assert that the interaction between components returns the expected value.
assertEquals([1], a.performAction());false which indicates failure.null which is not a boolean.0 which is not a boolean.The test expects performAction() to return true when components interact correctly.
Fix the error in the test setup to correctly initialize the components for integration testing.
ComponentA a = new ComponentA();
ComponentB b = [1];
a.setDependency(b);new keyword.The correct way to initialize ComponentB is by using new ComponentB().
Fill both blanks to complete the integration test that verifies interaction and result.
ComponentA a = new ComponentA(); ComponentB b = [1]; a.setDependency(b); assertEquals([2], a.performAction());
false as expected result.The test sets ComponentB as dependency and expects true from performAction().
Fill all three blanks to complete the integration test that sets up components, performs action, and asserts the result.
ComponentA a = new [1](); ComponentB b = new [2](); a.setDependency(b); boolean result = a.[3](); assertTrue(result);
The test creates instances of ComponentA and ComponentB, sets dependency, calls performAction(), and asserts the result.