You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/11/16 00:43:12 UTC

[GitHub] [pulsar-client-go] merlimat commented on a change in pull request #101: Add client function to list topics in a namespace.

merlimat commented on a change in pull request #101: Add client function to list topics in a namespace.
URL: https://github.com/apache/pulsar-client-go/pull/101#discussion_r347062977
 
 

 ##########
 File path: pulsar/client_impl_test.go
 ##########
 @@ -222,3 +221,84 @@ func TestTopicPartitions(t *testing.T) {
 	assert.Equal(t, len(partitions), 1)
 	assert.Equal(t, partitions[0], topic)
 }
+
+func TestNamespaceTopicsNamespaceDoesNotExit(t *testing.T) {
+	c, err := NewClient(ClientOptions{
+		URL: serviceURL,
+	})
+	if err != nil {
+		t.Errorf("failed to create client error: %+v", err)
+		return
+	}
+	defer c.Close()
+	ci := c.(*client)
+
+	// fetch from namespace that does not exist
+	name := generateRandomName()
+	topics, err := ci.namespaceTopics(fmt.Sprintf("%s/%s", name, name))
+	assert.Equal(t, 0, len(topics))
+}
+
+func TestNamespaceTopics(t *testing.T) {
+	name := generateRandomName()
+	namespace := fmt.Sprintf("public/%s", name)
+	namespaceUrl := fmt.Sprintf("http://localhost:8080/admin/v2/namespaces/%s", namespace)
 
 Review comment:
   In `test_helper.go` we have: 
   
   ```
   	serviceURL    = "pulsar://localhost:6650"
   	serviceURLTLS = "pulsar+ssl://localhost:6651
   ```
   
   we could add the `http://localhost:8080` there as well

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services