- java.lang.Object
-
- io.ebean.test.DbJson.PrettyJson
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringasJson()Return the JSON content.voidassertContains(String json)Assert the DB json contains the given json content.voidassertContainsResource(String resourcePath)Assert the DB Json contains the Json at the given resource path.voidassertContentMatches(String resourcePath)Assert the json exactly matches the content at the given resource path.DbJson.PrettyJsonreplace(String... propertyNames)Replace the values of the given properties with a placeholder value.DbJson.PrettyJsonwithPlaceholder(String placeHolder)Set the placeHolder to use when replacing property values.
-
-
-
Method Detail
-
withPlaceholder
public DbJson.PrettyJson withPlaceholder(String placeHolder)
Set the placeHolder to use when replacing property values.
-
replace
public DbJson.PrettyJson replace(String... propertyNames)
Replace the values of the given properties with a placeholder value.Typically we do this on generated properties such as id and timestamp properties.
-
asJson
public String asJson()
Return the JSON content.
-
assertContentMatches
public void assertContentMatches(String resourcePath)
Assert the json exactly matches the content at the given resource path.DbJson.of(timedEntries) .replace("id", "eventTime") .assertContentMatches("/assertJson/full-1-timed.json");
-
assertContains
public void assertContains(String json)
Assert the DB json contains the given json content.With this "contains" check the DB Json can contain more content than what it is checked against. Typically the DB json can contain generated properties like id values, when created, when modified etc and we leave these out of the json content we are checking against.
- Parameters:
json- The subset json content that should be contained by the DB json.
-
assertContainsResource
public void assertContainsResource(String resourcePath)
Assert the DB Json contains the Json at the given resource path.With this "contains" check the DB Json can contain more content than what it is checked against. Typically the DB json can contain generated properties like id values, when created, when modified etc and we leave these out of the json content we are checking against.
- Parameters:
resourcePath- The resource path of the JSON content we are checking against.
-
-