Package io.ebean.test

Class DbJson


  • public class DbJson
    extends Object
    Helper for testing to assert that the JSON form of an entity or list of entities match a String / typically test resource.
    
    
        DbJson.of(timedEntries)
          .replace("id", "eventTime")
          .assertContentMatches("/assertJson/full-1-timed.json");
    
     
    • Constructor Detail

    • Method Detail

      • of

        public static DbJson.PrettyJson of​(Object bean)
        Create a PrettyJson object that has the JSON form of the entity bean or beans.
        
        
            DbJson.of(timedEntries)
              .replace("id", "eventTime")
              .assertContentMatches("/assertJson/full-1-timed.json");
        
         
      • readResource

        public static String readResource​(String resourcePath)
        Read the content for the given resource path.