-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-4335] Remove checks on mock/util function
External unit tests that call `GenerateMockPublicPrivateKeyPairPEM` shouldn't have to check for the error returned by this function. This should be checked once by the `TestGenerateMockPublicPrivateKeyPairPEM` test. This changeset addresses this. Change-Id: Ia70f707f4943647ef614533686b99105213e855d Signed-off-by: Kostas Christidis <kostas@christidis.io>
- Loading branch information
1 parent
a690a05
commit 56d06f7
Showing
4 changed files
with
35 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
Copyright IBM Corp. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package util | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestGenerateMockPublicPrivateKeyPairPEM(t *testing.T) { | ||
_, _, err := GenerateMockPublicPrivateKeyPairPEM(false) | ||
assert.NoError(t, err, "Unable to generate a public/private key pair: %v", err) | ||
} | ||
|
||
func TestGenerateMockPublicPrivateKeyPairPEMWhenCASet(t *testing.T) { | ||
_, _, err := GenerateMockPublicPrivateKeyPairPEM(true) | ||
assert.NoError(t, err, "Unable to generate a signer certificate: %v", err) | ||
} |