github.com/ethersphere/bee/v2@v2.2.0/pkg/api/topology_test.go (about)

     1  // Copyright 2020 The Swarm Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package api_test
     6  
     7  import (
     8  	"net/http"
     9  	"testing"
    10  
    11  	"github.com/ethersphere/bee/v2/pkg/jsonhttp/jsonhttptest"
    12  )
    13  
    14  func TestTopologyOK(t *testing.T) {
    15  	t.Parallel()
    16  
    17  	testServer, _, _, _ := newTestServer(t, testServerOptions{})
    18  
    19  	var body []byte
    20  	opts := jsonhttptest.WithPutResponseBody(&body)
    21  	jsonhttptest.Request(t, testServer, http.MethodGet, "/topology", http.StatusOK, opts)
    22  
    23  	if len(body) == 0 {
    24  		t.Error("empty response")
    25  	}
    26  }