github.com/confluentinc/confluent-kafka-go@v1.9.2/kafka/event_test.go (about)

     1  /**
     2   * Copyright 2016 Confluent Inc.
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   * http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  package kafka
    18  
    19  import (
    20  	"testing"
    21  )
    22  
    23  // TestEventAPIs dry-tests the public event related APIs, no broker is needed.
    24  func TestEventAPIs(t *testing.T) {
    25  	assignedPartitions := AssignedPartitions{}
    26  	t.Logf("%s\n", assignedPartitions.String())
    27  
    28  	revokedPartitions := RevokedPartitions{}
    29  	t.Logf("%s\n", revokedPartitions.String())
    30  
    31  	topic := "test"
    32  	partition := PartitionEOF{Topic: &topic}
    33  	t.Logf("%s\n", partition.String())
    34  
    35  	partition = PartitionEOF{}
    36  	t.Logf("%s\n", partition.String())
    37  
    38  	committedOffsets := OffsetsCommitted{}
    39  	t.Logf("%s\n", committedOffsets.String())
    40  
    41  	stats := Stats{"{\"name\": \"Producer-1\"}"}
    42  	t.Logf("Stats: %s\n", stats.String())
    43  
    44  	oauthBearerTokenRefresh := OAuthBearerTokenRefresh{"some=config"}
    45  	t.Logf("%s\n", oauthBearerTokenRefresh.String())
    46  }