<commit_before>package com.twitter.finatra.tests.json.internal.caseclass.validation.validators

import com.twitter.finatra.json.internal.caseclass.validation.validators.MaxValidator
import com.twitter.finatra.validation.ValidationResult.{invalid, valid}
import com.twitter.finatra.validation.{Max, ValidationResult, ValidatorTest}

case class MaxIntExample(@Max(0) numberValue: Int)
case class MaxLongExample(@Max(0) numberValue: Long)
case class MaxBigIntExample(@Max(0) numberValue: BigInt)
case class MaxLargestLongBigIntExample(@Max(Long.MaxValue) numberValue: BigInt)
//case class MaxSecondLargestLongBigIntExample(@Max(Long.MaxValue - 1) numberValue: BigInt)*/
case class MaxSmallestLongBigIntExample(@Max(Long.MinValue) numberValue: BigInt)
case class MaxBigDecimalExample(@Max(0) numberValue: BigDecimal)
case class MaxLargestLongBigDecimalExample(@Max(Long.MaxValue) numberValue: BigDecimal)
//case class MaxSecondLargestLongBigDecimalExample(@Max(Long.MaxValue - 1) numberValue: BigDecimal)*/
case class MaxSmallestLongBigDecimalExample(@Max(Long.MinValue) numberValue: BigDecimal)
case class MaxSeqExample(@Max(0) numberValue: Seq[Int])
case class MaxArrayExample(@Max(0) numberValue: Array[Int])
case class MaxInvalidTypeExample(@Max(0) numberValue: String)

class MaxValidatorTest extends ValidatorTest {

  "max validator" should {

    "pass validation for int type" in {
      val value = 0
      validate[MaxIntExample](value) should equal(valid)
    }

    "fail validation for int type" in {
      val value = 1
      validate[MaxIntExample](value) should equal(
        invalid(
          errorMessage(value)))
    }

    "pass validation for long type" in {
      val value = 0L
      validate[MaxLongExample](value) should equal(valid)<commit_msg>Comment out code that causes javadoc generation to fail.<commit_after>package com.twitter.finatra.tests.json.internal.caseclass.validation.validators

import com.twitter.finatra.json.internal.caseclass.validation.validators.MaxValidator
import com.twitter.finatra.validation.ValidationResult.{invalid, valid}
import com.twitter.finatra.validation.{Max, ValidationResult, ValidatorTest}

case class MaxIntExample(@Max(0) numberValue: Int)
case class MaxLongExample(@Max(0) numberValue: Long)
case class MaxBigIntExample(@Max(0) numberValue: BigInt)
case class MaxLargestLongBigIntExample(@Max(Long.MaxValue) numberValue: BigInt)
//case class MaxSecondLargestLongBigIntExample(@Max(Long.MaxValue - 1) numberValue: BigInt)
case class MaxSmallestLongBigIntExample(@Max(Long.MinValue) numberValue: BigInt)
case class MaxBigDecimalExample(@Max(0) numberValue: BigDecimal)
case class MaxLargestLongBigDecimalExample(@Max(Long.MaxValue) numberValue: BigDecimal)
//case class MaxSecondLargestLongBigDecimalExample(@Max(Long.MaxValue - 1) numberValue: BigDecimal)
case class MaxSmallestLongBigDecimalExample(@Max(Long.MinValue) numberValue: BigDecimal)
case class MaxSeqExample(@Max(0) numberValue: Seq[Int])
case class MaxArrayExample(@Max(0) numberValue: Array[Int])
case class MaxInvalidTypeExample(@Max(0) numberValue: String)

class MaxValidatorTest extends ValidatorTest {

  "max validator" should {

    "pass validation for int type" in {
      val value = 0
      validate[MaxIntExample](value) should equal(valid)
    }

    "fail validation for int type" in {
      val value = 1
      validate[MaxIntExample](value) should equal(
        invalid(
          errorMessage(value)))
    }

    "pass validation for long type" in {
      val value = 0L
      validate[MaxLongExample](value) should equal(valid)
{'fraction_non_alphanumeric': 0.0958904109589041, 'fraction_numerical': 0.006709533128319821, 'mean_word_length': 5.880769230769231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3529649', 'n_tokens_mistral': 1042, 'n_tokens_neox': 1018, 'n_words': 253}