AD0-E137 Exam Question 21

A developer is required to create a package with these requirements:
Package Name: aem-package
Content Path: /content/aem-site
Group: aem_group
What is the correct zip package file created in Adobe Experience Manager package manager?
  • AD0-E137 Exam Question 22

    A client has a requirement to get the location of stores based on the zip code authored in the component dialog. Location needs to be pulled from an external API using OSGi services.
    Which OSGi Service code snippet should be used to represent the requirement?
    A)
    @OSGIService(component = Service.class)
    public class ServiceImpl implements Service {
    @Override
    public List<String> getStoresByZipCode(String zipCode) {
    List<String> storeLocations = new ArrayList<>();
    // Create an HTTP client
    try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
    // Processing logic to get all the locations from external api
    } catch (IOException e) {
    }
    return storeLocations;
    }
    }
    B)
    @Component(service = Service.class)
    public class ServiceImpl implements Service {
    @Override
    public List<String> getStoresByZipCode(String zipCode) {
    List<String> storeLocations = new ArrayList<>();
    // Create an HTTP client
    try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
    // Processing logic to get all the locations from external api
    } catch (IOException e) {
    }
    return storeLocations;
    }
    }
    C)
    @Service(service = Component.class)
    public class ServiceImpl implements Service {
    @Override
    public List<String> getStoresByZipCode(String zipCode) {
    List<String> storeLocations = new ArrayList<>();
    // Create an HTTP client
    try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
    // Processing logic to get all the locations from external api
    } catch (IOException e) {
    }
    return storeLocations;
    }
    }
  • AD0-E137 Exam Question 23

    A developer is writing a unit test for a service that depends on a query of nodes inside the JCR.
    What is the correct approach to unit testing the service?