MuleSoft MCD - Level 1 Practice Test - Questions Answers
List of questions
Related questions
Question 1
Refer to the exhibit.
What is the correct syntax to add an employee ID as a URI parameter in an HTTP Listener path?
Explanation:
Paths
The path of an HTTP listener can be static, which requires exact matches, or feature placeholders. Placeholders can be wildcards (*), which match against anything they are compared to, or parameters ({param}), which not only match against anything but also capture those values on a URI parameters map.
Take the following example paths for three listeners using a configuration that establishesapi/v1as the base path:
account/mulesoft/main-contact: only match the exact path requesthttp://awesome-company.com/api/v1/account/mulesoft/main-contact
account/{accountId}/main-contact: matches all path requests structured similarly, such ashttp://awesome-company.com/api/v1/account/salesforce/main-contact, and savesalesforceas the value ofaccountId.
account/{accountId}/*: matches all path requests different frommain-contact, such ashttp://awesome-company.com/api/v1/account/mulesoft/users, and savemulesoftas the value ofaccountId.
Mule Ref Doc :https://docs.mulesoft.com/http-connector/1.6/http-listener-ref#paths
Question 2
An SLA based policy has been enabled in API Manager. What is the next step to configure the API proxy to enforce the new SLA policy?
Explanation:
Correct answer is Add required headers to RAML specification and redeploy new API proxy
MuleSoft Doc Ref : https://docs.mulesoft.com/api-manager/2.x/tutorial-manage-an-api
Steps are as below :
Add the Required RAML Snippet
SLA-based rate limiting requires adding a RAML or OAS snippet to your API. This procedure demonstrates adding a RAML snippet.
Specify the client ID and secret as query parameters.
Add a section called traits: at the RAML root level to define query parameters:
traits:
- client-id-required:
queryParameters:
client_id:
type: string
client_secret:
type: string
Add the client-id-required trait to every method that requires these query parameters:
/users:
get:
is: [client-id-required]
description: Gets a list of JSONPlaceholder users.
Step 2 : Add the SLA Tier in API Manager
Step 3 : Apply the policy and redeploy
Question 3
What payload is returned by a Database SELECT operation that does not match any rows in the database?
Explanation:
Empty array is returned when no rows are matched.
MuleSoft Doc Ref : https://docs.mulesoft.com/db-connector/1.9/database-connector-select
Question 4
What is the correct syntax to define and call a function in Database?
A)
B)
C)
D)
Explanation:
Keyword to ad function in Dataweave transformation is fun. Hence option 2 and 4 are invalid. Also parameters needs to be passed exactly in same order as defined in function definition. Hence correct answer is'
fun addKV( object: Object, key: String, value: Any) =
object ++ {(key):(value)}
---
addKV ( {'hello': 'world'}, 'hola', 'mundo' )
MuleSoft Documentation Reference : https://docs.mulesoft.com/mule-runtime/4.3/dataweave-functions
DataWeave Function Definition Syntax
To define a function in DataWeave use the following syntax:
fun myFunction(param1, param2, ...) = <code to execute>
The fun keyword starts the definition of a function.
myFunction is the name you define for the function.
Function names must be valid identifiers.
(param1, param2, ... , paramn) represents the parameters that your function accepts.
You can specify from zero to any number of parameters, separated by commas (,) and enclosed in parentheses.
The = sign marks the beginning of the code block to execute when the function is called.
<code to execute> represents the actual code that you define for your function.
Question 5
Refer to the exhibits.
A Mule application contains a Choice router. What is logged when the flow completes?
Question 6
Refer to the exhibit.
The Mule application Is debugged in Any point Studio and stops at the breakpoint What is the value of the payload displayed In the debugger at this breakpoint?
Question 7
Refer to the exhibit.
What DataWeave expression transforms the conductorlds array to the XML output?
A)
B)
C)
D)
Question 8
A function named newProdCode needs to be defined that accepts two input parameters, an integer value for itemID and a string value for productCategory, and returns a new product code.
What is the correct DataWeave code to define the newProdCode function?
Question 9
Refer to the exhibits.
The Set Payload transformer In the addltem subflow uses DataWeave to create an order object.
What is the correct DataWeave code for the Set Payload transformer in the createOrder flow to use the addltem subflow to add a router cable with the price of 100 to the order?
Question 10
A Mule project contains a DataWeave module called MyModule.dwl that defines a function named formatString. The module is located in the project's src/main/resources/modules folder.
What is the correct way in DataWeave code to import MyModule using a wildcard and then call the module's formatString function?
A)
B)
C)
D)
Question