Coverage Summary for Class: MovieEntity (concept.stc.data.local.entity)

Class Method, % Line, %
MovieEntity 100% (1/1) 100% (8/8)
MovieEntity$Companion 100% (1/1) 100% (6/6)
Total 100% (2/2) 100% (14/14)


 package concept.stc.data.local.entity
 
 import org.springframework.data.annotation.Id
 import org.springframework.data.relational.core.mapping.Column
 import org.springframework.data.relational.core.mapping.Table
 
 /**
  * Represents movie entity in a database.
  *
  * @param id the primary key auto-generated by a database.
  * @param title the movie title.
  * @param year the movie year.
  * @param imdbId the IMDB id.
  * @param type the type of movie, e.g. "movie", "game", etc.
  * @param poster the movie poster url.
  */
 @Table("movies")
 data class MovieEntity(
     @Id
     @Column(value = "id") val id: Int? = null,
     @Column(value = "title") val title: String,
     @Column(value = "movie_year") val year: String,
     @Column(value = "imdb_id") val imdbId: String,
     @Column(value = "type") val type: String,
     @Column(value = "poster") val poster: String
 ) {
     /**
      * Companion helper object.
      */
     companion object {
         /**
          * Creates an empty [MovieEntity] instance useful for testing.
          */
         fun empty() = MovieEntity(
             title = "",
             year = "",
             imdbId = "",
             type = "",
             poster = ""
         )
     }
 }