ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 62 - AD0-E103 discussion

Report
Export

A banking AEM application contains functionality to calculate a mortgage rate based on user input. A servlet in place calculates the result in the backend. A call to an internal third-party REST service is required to retrieve the average object value based on a given zip code.

The following three service interfaces are used:

MortgageCalculationServlet, MortgageCalculationService and ObjectValueLookupRestService where MortgageCalculationServlet has a dependency to MortgageCalculationService and MortgageCalculationService has a dependency to ObjectValueLookupRestService.

The calculation has many combinations of input parameters and edge cases, so the JUnit coverage must be as high as possible.

Which two strategies should the developer use to ensure testability of the application code? (Choose two.)

A.
Use BundleContext.getServiceReference(…) and BundleContext.getService(…) in application code to look up the required services just before usage.
Answers
A.
Use BundleContext.getServiceReference(…) and BundleContext.getService(…) in application code to look up the required services just before usage.
B.
Use static methods to avoid boilerplate in application code.
Answers
B.
Use static methods to avoid boilerplate in application code.
C.
Use a mock framework to be able to create and inject mocks in the test code.
Answers
C.
Use a mock framework to be able to create and inject mocks in the test code.
D.
Use the standard OSGi @Reference annotation to wire the dependencies in application code.
Answers
D.
Use the standard OSGi @Reference annotation to wire the dependencies in application code.
E.
Deploy a third party dependency injection container to wire dependencies more efficiently in application code.
Answers
E.
Deploy a third party dependency injection container to wire dependencies more efficiently in application code.
Suggested answer: C, D
asked 02/10/2024
Marcelo Severo
38 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first