FreeQAs
 Request Exam  Contact
  • Home
  • View All Exams
  • New QA's
  • Upload
PRACTICE EXAMS:
  • Oracle
  • Fortinet
  • Juniper
  • Microsoft
  • Cisco
  • Citrix
  • CompTIA
  • VMware
  • SAP
  • EMC
  • PMI
  • HP
  • Salesforce
  • Other
  • Oracle
    Oracle
  • Fortinet
    Fortinet
  • Juniper
    Juniper
  • Microsoft
    Microsoft
  • Cisco
    Cisco
  • Citrix
    Citrix
  • CompTIA
    CompTIA
  • VMware
    VMware
  • SAP
    SAP
  • EMC
    EMC
  • PMI
    PMI
  • HP
    HP
  • Salesforce
    Salesforce
  1. Home
  2. Adobe Certification
  3. AD0-E722 Exam
  4. Adobe.AD0-E722.v2024-01-19.q17 Dumps
  • «
  • 1
  • 2
  • 3
  • 4
  • 5
  • »
Download Now

Question 1

An Architect wants to create an Integration Test that does the following:
* Adds a product using a data fixture
* Executes $this->someLogic->execute($product) on the product
* Checks if the result is true.
$this->someLogic has the correct object assigned in the setup() method.
Product creation and the tested logic must be executed in the context of two different store views with IDs of 3 and 4, which have been created and are available for the test.
How should the Architect meet these requirements?

Correct Answer: C
Explanation
To create an integration test that executes different logic in different store views, the Architect needs to do the following steps:
Create one test class that extends \Magento\TestFramework\TestCase\AbstractController or
\Magento\TestFramework\TestCase\AbstractBackendController, depending on the type of controller being tested1.
Create one test method that uses the @magentoDataFixture annotation to specify the data fixture file that creates the product2.
Use the \Magento\TestFramework\Store\ExecuteInStoreContext class to execute the fixture and the tested logic in different store views. This class has a method called executeInStoreContext, which takes two parameters: the store ID and a callable function. The callable function will be executed in the context of the given store ID, and then the original store ID will be restored3. For example:
PHPAI-generated code. Review and use carefully. More info on FAQ.
public function testSomeLogic()
{
// Get the product from the fixture
$product = $this->getProduct();
// Get the ExecuteInStoreContext instance from the object manager
$executeInStoreContext =
$this->_objectManager->get(\Magento\TestFramework\Store\ExecuteInStoreContext::class);
// Execute the fixture in store view 3
$executeInStoreContext->executeInStoreContext(3, function () use ($product) {
// Do some operations on the product in store view 3
});
// Execute the tested logic in store view 4
$result = $executeInStoreContext->executeInStoreContext(4, function () use ($product) {
// Call the tested logic on the product in store view 4
return $this->someLogic->execute($product);
});
// Assert that the result is true
$this->assertTrue($result);
}
References:
Integration tests | Magento 2 Developer Documentation
Data fixtures | Magento 2 Developer Documentation
Magento\TestFramework\Store\ExecuteInStoreContext | Magento 2 Developer Documentation
insert code

Question 2

An Adobe Commerce Architect needs to scope a bespoke news section for a merchants Adobe Commerce storefront. The merchant's SEO agency requests that the following URL structure:
news/{date}/{article_url_key}, where {date} is the publication date of the article, and {article_url_key} is the URL key of the article.
The Architect scopes that a news entity type will be created. The date and URL key data will be stored against each record and autogenerated on save. The values will be able to be manually overridden.

Correct Answer: B,C
Explanation
These two options are both valid ways to manage routing for the bespoke news section and adhere to best practice. Option B leverages the existing URL rewrite functionality of Adobe Commerce, which allows creating custom URLs for any entity type and storing them in the database. This option requires creating a standard controller route for the news entity type, such as news/article/view/id/i, where i is the news article ID.
Then, on saving each news article, a rewrite rule is generated that maps the internal URL to the desired SEO-friendly URL, such as news/{date}/{article_url_key}. The rewrite rule is stored in the url_rewrite table, which is used by the standard router to match and redirect requests.
Option C involves creating a custom router class that implements \Magento\Framework\App\RouterInterface and runs before the standard router in the routing process. The custom router class can match the news portion of the URL and extract the date and URL key parts from it. Then, it can look for and load a news articlethat matches those values using a model or repository class. If a match is found, it can set the request parameters accordingly and dispatch the request to a controller action that renders the news article page.
References:
Routing | Adobe Commerce Developer Guide
URL Rewrites | Adobe Commerce Developer Guide
Custom Router | Adobe Commerce Developer Guide
insert code

Question 3

A company wants to build an Adobe Commerce website to sell their products to customers in their country.
The taxes in their country are highly complex and require customization to Adobe Commerce. An Architect is trying to solve this problem by creating a custom tax calculator that will handle the calculation of taxes for all orders in Adobe Commerce.
Following best practices, how should the Architect add the taxes for all orders?

Correct Answer: C
Explanation
According to the Adobe Commerce documentation, the best way to add a custom tax calculation to all orders is to declare a new total collector in the "etc/sales.xml" file of a custom module. This way, the custom tax logic can be implemented in a separate class that extends the
\Magento\Quote\Model\Quote\Address\Total\AbstractTotal class and overrides the collect() and fetch() methods. The collect() method is responsible for calculating the tax amount and adding it to the quote address, while the fetch() method is responsible for displaying the tax amount in the cart and checkout pages. The new total collector can be assigned to any area of the order totals, such as before or after the subtotal, shipping, or grand total.
References:
Customizing order totals
How to add custom fee or discount to order totals in Magento 2
insert code

Question 4

An Adobe Commerce Architect designs and implements functionality that introduces a new Complex Product Type to the existing Adobe Commerce website. Besides visual demonstration of the new product type, the changes include adjustments to the price index.
The website utilizes a multi-dimensional indexer feature to store the price index. The Architect decides to cover it with integration tests. After creating and running one test, the Architect discovers that database storage is not being fully cleaned.
The test method has the following annotation declaration:

Which adjustment should the Architect make to fix this issue?

Correct Answer: B
Explanation
The issue here is that the database storage is not being fully cleaned after the test is run. The solution is to modify the method PHPDoc and change the annotation @magentoDbIsolation to enabled. This will ensure that the database storage is fully cleaned after the test is run. References:
https://developer.adobe.com/commerce/testing/guide/integration/#database-isolation1
insert code

Question 5

An Architect working on a headless Adobe Commerce project creates a new customer attribute named my_attribute. Based on the attribute value of the customer, the results of GraphQI queries are modified using a plugin. The frontend application is communicating with Adobe Commerce through Varnish by Fastly. which is already caching the queries that will be modified. The Adobe Commerce Fastly extension is installed, and no other modifications are made to the application.
Which steps should the Architect take to make sure the vcl_hash function of Varnish also considers the newly created attribute?

Correct Answer: A
Explanation
To make sure the vcl_hash function of Varnish considers the newly created attribute, the Architect needs to do the following steps:
Create a new class that implements the
Magento\GraphQlCache\Model\CacheId\CacheIdFactorProviderInterface interface. This interface defines two methods: getFactorName and getFactorValue. The getFactorName method should return the name of the attribute, in this case, my_attribute. The getFactorValue method should return the value of the attribute for the current customer, which can be obtained from the customer session or customer repository1.
Add this class to the idFactorProviders array of
Magento\GraphQlCache\Model\CacheId\CacheIdCalculator through dependency injection. The CacheIdCalculator is responsible for generating a cache ID for each GraphQL request based on the factors provided by the idFactorProviders. By adding the new class to this array, the Architect ensures that the cache ID will include the value of my_attribute1.
The cache ID is then used by Varnish to hash and lookup the cached response for each request. By including my_attribute in the cache ID, the Architect ensures that Varnish will serve different responses based on the attribute value of the customer2.
Magento_GraphQlCache module | Magento 2 Developer Documentation
Varnish caching | Adobe Commerce 2.4 User Guide - Magento
insert code
  • «
  • 1
  • 2
  • 3
  • 4
  • 5
  • »
[×]

Download PDF File

Enter your email address to download Adobe.AD0-E722.v2024-01-19.q17 Dumps

Email:

FreeQAs

Our website provides the Largest and the most Latest vendors Certification Exam materials around the world.

Using dumps we provide to Pass the Exam, we has the Valid Dumps with passing guranteed just which you need.

  • DMCA
  • About
  • Contact Us
  • Privacy Policy
  • Terms & Conditions
©2025 FreeQAs

www.freeqas.com materials do not contain actual questions and answers from Cisco's certification exams.