mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-14 11:03:09 +02:00
7ad96ee686
* including a artifact cpe type * removing type kind related to PR 3717 * clean up * eliminating local path * go formatting fix Co-authored-by: anilkeshav27 <you@example.com>
20 lines
395 B
Go
20 lines
395 B
Go
package piperenv
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func Test_Artifacts_FindByName(t *testing.T) {
|
|
artifacts := Artifacts([]Artifact{{
|
|
Name: "a.jar",
|
|
}})
|
|
|
|
assert.Len(t, artifacts.FindByName("garbage"), 0)
|
|
filtered := artifacts.FindByName("a.jar")
|
|
require.Len(t, filtered, 1)
|
|
assert.Equal(t, "a.jar", filtered[0].Name)
|
|
}
|