From 554f949ca217ceb59479e4dca08a1c7b17cde7f1 Mon Sep 17 00:00:00 2001 From: Michal Vyskocil Date: Mon, 2 Dec 2024 16:42:07 +0100 Subject: [PATCH] remove document markers from a unit test --- modules/nats/nats_test.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/modules/nats/nats_test.go b/modules/nats/nats_test.go index 13bbfcfa48..8da8b9363e 100644 --- a/modules/nats/nats_test.go +++ b/modules/nats/nats_test.go @@ -69,31 +69,25 @@ authorization { ` ctx := context.Background() - // createNATSContainer { ctr, err := tcnats.Run(ctx, "nats:2.9", tcnats.WithConfigFile(strings.NewReader(natsConf))) - // } testcontainers.CleanupContainer(t, ctr) require.NoError(t, err) - // connectionString { uri, err := ctr.ConnectionString(ctx) - // } require.NoError(t, err) - // connect without token { + // connect without a correct token must fail mallory, err := nats.Connect(uri, nats.Name("Mallory"), nats.Token("secret")) - // } require.Error(t, err) require.ErrorIs(t, err, nats.ErrAuthorization) t.Cleanup(mallory.Close) - // connect via token { + // connect with a correct token must succeed nc, err := nats.Connect(uri, nats.Name("API Token Test"), nats.Token("s3cr3t")) - // } require.NoError(t, err) t.Cleanup(nc.Close) - // validate /etc/nats.conf mentioned in logs { + // validate /etc/nats.conf mentioned in logs const expected = "Using configuration file: /etc/nats.conf" logs, err := ctr.Logs(ctx) require.NoError(t, err) @@ -105,6 +99,5 @@ authorization { break } } - // } require.Truef(t, found, "expected log line not found: %s", expected) }