exam questions

Exam AD0-E103 All Questions

View all questions & answers for the AD0-E103 exam

Exam AD0-E103 topic 1 question 62 discussion

Actual exam question from Adobe's AD0-E103
Question #: 62
Topic #: 1
[All AD0-E103 Questions]

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.
  • 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.
  • 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.
Show Suggested Answer Hide Answer
Suggested Answer: CD 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
chunpin
4 years, 2 months ago
A and C https://sling.apache.org/documentation/development/osgi-mock.html
upvoted 1 times
...
grios
4 years, 7 months ago
A and C
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago