Challenge - Enhance The Calculator Service

Challenge - Enhance The Calculator Service

In this Challenge, you are tasked with extending the implementation you just deployed, to allow it to handle division, subtraction, multiplication as well as addition which is already implemented. This will require you to:

  • Update the state machine definition to define the new operators’ workflow
  • Update the source code to implement the new operators
  • Update the CloudFormation template.yml to add in the state machine changes and wire-up the Lambda function as a Task for each of the new states.
  1. Download file CalculatorStepFull.zip to the Windows virtual machine and extract
  2. In the Eclipse IDE, click menu File
  • Click Import… Enhance The Calculator Service
  1. Click Maven
  • Select Existing Maven projects
  • Click Next Enhance The Calculator Service
  1. Click Browse…
  • Select the directory of CalculatorStepFull project we extract in the step 1
  • Click Finish Enhance The Calculator Service
  1. In the Eclipse IDE, right-click on the root element of the calculator_full project
  • Click Run As
  • Click JUnit Test Enhance The Calculator Service
  1. We will receive the following result Enhance The Calculator Service
  2. Open Command Prompt and navigate to the directory of CalculatorStepFull project we extracted in the step 1
  • Execute the command mvn package to build Enhance The Calculator Service
  1. When the target JAR is built, whick is in the folder target of the project and whose name is calculator_full-1.0.0.jar Enhance The Calculator Service
  2. Go to AWS Lambda console.
  • Click Functions.
  • Type idevelop_basic_calculator to the search bar, press Enter
  • Click idevelop_basic_calculator. Enhance The Calculator Service
  1. In the Code soure section
  • Click Upload from
  • Click .zip or .jar file Enhance The Calculator Service
  1. Click Upload
  • Select file calculator_full-1.0.0.jar was built in the step 7
  • Click Save Enhance The Calculator Service
  1. CLick tab Test
  • In the Event JSON section, type
{
  "operator" : "subtract",
  "operands" : [
      1,
      2
  ]
}
  • Click Test Enhance The Calculator Service
  1. Click Details to see the result Enhance The Calculator Service
  2. We will receive the following result Enhance The Calculator Service
  3. Check with multiply operator
  • In the Event JSON section, type
{
  "operator" : "multiply",
  "operands" : [
      1,
      2
  ]
}
  • Click Test Enhance The Calculator Service
  1. We will receive the following result Enhance The Calculator Service