java.lang.Object
io.ebean.test.DbJson.PrettyJson
- Enclosing class:
DbJson
Contains the JSON of beans(s).
-
Method Summary
Modifier and TypeMethodDescriptionasJson()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.Replace the values of the given properties with a placeholder value.withPlaceholder(String placeHolder) Set the placeHolder to use when replacing property values.
-
Method Details
-
withPlaceholder
Set the placeHolder to use when replacing property values. -
replace
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
Return the JSON content. -
assertContentMatches
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
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
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.
-