1

I have this class in my application written in kotlin:

import com.google.gson.annotations.SerializedName
import java.util.Date

internal data class CloseLotDto(
    @SerializedName(value = "id") val closeLotId: String?,
    @SerializedName(value = "user_id") val userID: Long,
    @SerializedName(value = "address") val address: String,
    @SerializedName(value = "date_from") val dateFrom: Date,
    @SerializedName(value = "date_to") val dateTo: Date,
    @SerializedName(value = "point_of_interaction") val pointOfInteraction: PointOfInteractionDto,
    @SerializedName(value = "identification") val identification: String?,
    @SerializedName(value = "contents") val contents: List<SubContentDto>,
)

However, jacoco's coverage is accusing coverage failure in this class: jacoco kotlin coverage

I would like to know if there is a way to make jacoco ignore gson's @SerializedName annotation so that test coverage is not harmed.

Pierre Vieira
  • 2,252
  • 4
  • 21
  • 41

0 Answers0