Question: / / fill out the code and make sure it works / / dto . java package question 2 ; public class Dto { public
fill out the code and make sure it works
dtojava
package question;
public class Dto
public static Dto getSampleDto
return null;
questionjava
package question;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.testng.Assert;
import org.testng.annotations.Test;
public class Question
You are creating an api that returns some data about characters for a video game
The devs on another team have provided you a sample json payload with the data they would like to receive
Create DTO objects that will serialize to the following sample payload
@Test
public void test
String sampleJson
"name": "Dragon config",
"datapoints":
"name": "Dragon",
"favoriteNumber":
"color": "Grey",
"data":
a:
b:
c: C
"dataMapping":
"green":
"name": "Wings",
"count":
;
Gson gson new GsonBuildersetPrettyPrintingcreate;
var dto Dto.getSampleDto;
Assert.assertEqualsgsontoJsondto sampleJson;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
