Free CoreSpringV3.2 Exam Braindumps
Core-Spring (based on Spring 3.2) Questions 26–30 (page: 7)

Updated On: 9-Feb-2026

Which of the following statements best describes the benefits of using the Spring Framework with respect to unit testing? (Select one)

  1. Your Java code typically has dependencies on Spring Framework classes which are designed to make the job of unit testing easier
  2. The Spring Framework encourages you to program to interfaces which makes it easier to stub or mock out dependencies in your code
  3. The extensive runtime checks performed by the ApplicationContext when it initializes make traditional unit testing less important
  4. All of the above

Answer(s): B



Which of the following statements about Spring and unit testing is true? (Select one)

  1. Spring provides an internal mock framework so there is no need for a third-party mock framework such as Mockito or EasyMock
  2. Spring provides an abstraction to existing Mock frameworks
  3. Both a and b
  4. Neither a or b

Answer(s): D



Which of the following statements about Spring's JUnit integration testing support is true? (select one)

  1. A new ApplicationContext is initialized and created for each test method
  2. To obtain references to the Spring bean(s) you want to test, you need to call getBean() on the ApplicationContext provided
  3. You can indicate which XML configuration files the test class will use to create the
    ApplicationContext
  4. All of the above

Answer(s): C



import com.springsource.service.*;

...
@Configuration public class AppConfig {
@Bean public ClientService clientService() {
return new ClientServiceImpl();
}
}

What is the id of the declared bean? (Select one)

  1. clientService (starting with lower-case "c")
  2. ClientService (starting with capital "C")
  3. com.springsource.service.ClientService
  4. com.springsource.service.ClientServiceImpl

Answer(s): A



public class AppConfig {

public ClientService clientService() {
return new ClientServiceImpl();
}
}

The Spring Java configuration above is NOT correct.
Why? (select one)

  1. The class should be annotated with @Configuration
  2. The method should be annotated with @Bean
  3. Both (a) and (b)
  4. Neither (a) or (b)

Answer(s): C



Viewing page 7 of 21
Viewing questions 31 - 35 out of 97 questions


Post your Comments and Discuss SpringSource CoreSpringV3.2 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!