Full Mattermost server source with integrated Community Enterprise features. Includes vendor directory for offline/air-gapped builds. Structure: - enterprise-impl/: Enterprise feature implementations - enterprise-community/: Init files that register implementations - enterprise/: Bridge imports (community_imports.go) - vendor/: All dependencies for offline builds Build (online): go build ./cmd/mattermost Build (offline/air-gapped): go build -mod=vendor ./cmd/mattermost 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
45 lines
1.2 KiB
Go
45 lines
1.2 KiB
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package marketplace
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestBuildURL(t *testing.T) {
|
|
config := &Client{}
|
|
|
|
testCases := map[string]struct {
|
|
base string
|
|
path string
|
|
expected string
|
|
}{
|
|
"Base url with trailing slash and path with leading slash": {
|
|
base: "https://api.integrations.mattermost.com/",
|
|
path: "/api/v1/plugins",
|
|
expected: "https://api.integrations.mattermost.com/api/v1/plugins",
|
|
},
|
|
"Base url without trailing slash and path with leading slash": {
|
|
base: "https://api.integrations.mattermost.com",
|
|
path: "/api/v1/plugins",
|
|
expected: "https://api.integrations.mattermost.com/api/v1/plugins",
|
|
},
|
|
"Base url without trailing slash and path without leading slash": {
|
|
base: "https://api.integrations.mattermost.com",
|
|
path: "api/v1/plugins",
|
|
expected: "https://api.integrations.mattermost.com/api/v1/plugins",
|
|
},
|
|
}
|
|
|
|
for name, tt := range testCases {
|
|
t.Run(name, func(t *testing.T) {
|
|
config.address = tt.base
|
|
actual := config.buildURL(tt.path)
|
|
assert.Equal(t, tt.expected, actual)
|
|
})
|
|
}
|
|
}
|