main = defaultMain $ testGroup "Kafka tests"
  [ testGroup "Round trip serialization" 
    [ supportTypeTests
    , testGroup "ConsumerMetadata"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: GroupCoordinatorRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: GroupCoordinatorResponseV0)
      ]
    , testGroup "Fetch"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: FetchRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: FetchResponseV0)
      ]
    , testGroup "Metadata"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: MetadataRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: MetadataResponseV0)
      ]
    , testGroup "Offset"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: OffsetRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: OffsetResponseV0)
      ]
    , testGroup "OffsetCommit"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: OffsetCommitRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: OffsetCommitResponseV0)
      , testProperty "Request V1" $ \x -> roundTrip (x :: OffsetCommitRequestV1)
      , testProperty "Response V1" $ \x -> roundTrip (x :: OffsetCommitResponseV1)
      , testProperty "Request V2" $ \x -> roundTrip (x :: OffsetCommitRequestV2)
      , testProperty "Response V2" $ \x -> roundTrip (x :: OffsetCommitResponseV2)
      ]
    , testGroup "OffsetFetch"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: OffsetFetchRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: OffsetFetchResponseV0)
      , testProperty "Request V1" $ \x -> roundTrip (x :: OffsetFetchRequestV1)
      , testProperty "Response V1" $ \x -> roundTrip (x :: OffsetFetchResponseV1)
      ]
    , testGroup "Produce"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: ProduceRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: ProduceResponseV0)
      ]
    ]
  , connectionTests
  ]
main = defaultMain $ testGroup "Kafka tests"
  [ testGroup "Round trip serialization" 
    [ supportTypeTests
    , testGroup "ConsumerMetadata"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: GroupCoordinatorRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: GroupCoordinatorResponseV0)
      ]
    , testGroup "Fetch"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: FetchRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: FetchResponseV0)
      ]
    , testGroup "Metadata"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: MetadataRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: MetadataResponseV0)
      ]
    , testGroup "Offset"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: OffsetRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: OffsetResponseV0)
      ]
    , testGroup "OffsetCommit"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: OffsetCommitRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: OffsetCommitResponseV0)
      , testProperty "Request V1" $ \x -> roundTrip (x :: OffsetCommitRequestV1)
      , testProperty "Response V1" $ \x -> roundTrip (x :: OffsetCommitResponseV1)
      , testProperty "Request V2" $ \x -> roundTrip (x :: OffsetCommitRequestV2)
      , testProperty "Response V2" $ \x -> roundTrip (x :: OffsetCommitResponseV2)
      ]
    , testGroup "OffsetFetch"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: OffsetFetchRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: OffsetFetchResponseV0)
      , testProperty "Request V1" $ \x -> roundTrip (x :: OffsetFetchRequestV1)
      , testProperty "Response V1" $ \x -> roundTrip (x :: OffsetFetchResponseV1)
      ]
    , testGroup "Produce"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: ProduceRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: ProduceResponseV0)
      ]
    ]
  , connectionTests
  ]
main = defaultMain $ testGroup "Kafka tests"
  [ testGroup "Round trip serialization" 
    [ supportTypeTests
    , testGroup "ConsumerMetadata"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: GroupCoordinatorRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: GroupCoordinatorResponseV0)
      ]
    , testGroup "Fetch"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: FetchRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: FetchResponseV0)
      ]
    , testGroup "Metadata"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: MetadataRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: MetadataResponseV0)
      ]
    , testGroup "Offset"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: OffsetRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: OffsetResponseV0)
      ]
    , testGroup "OffsetCommit"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: OffsetCommitRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: OffsetCommitResponseV0)
      , testProperty "Request V1" $ \x -> roundTrip (x :: OffsetCommitRequestV1)
      , testProperty "Response V1" $ \x -> roundTrip (x :: OffsetCommitResponseV1)
      , testProperty "Request V2" $ \x -> roundTrip (x :: OffsetCommitRequestV2)
      , testProperty "Response V2" $ \x -> roundTrip (x :: OffsetCommitResponseV2)
      ]
    , testGroup "OffsetFetch"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: OffsetFetchRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: OffsetFetchResponseV0)
      , testProperty "Request V1" $ \x -> roundTrip (x :: OffsetFetchRequestV1)
      , testProperty "Response V1" $ \x -> roundTrip (x :: OffsetFetchResponseV1)
      ]
    , testGroup "Produce"
      [ testProperty "Request V0" $ \x -> roundTrip (x :: ProduceRequestV0)
      , testProperty "Response V0" $ \x -> roundTrip (x :: ProduceResponseV0)
      ]
    ]
  , connectionTests
  ]