-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: correct date parsing in case of null value
- Loading branch information
1 parent
943716b
commit 3ce2968
Showing
2 changed files
with
14 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,6 +95,17 @@ func TestClientService_Collect(t *testing.T) { | |
assert.Equal(t, "Test", *cert) | ||
} | ||
|
||
func TestClientService_ListByEmailNil(t *testing.T) { | ||
httpmock.Activate() | ||
defer httpmock.DeactivateAndReset() | ||
httpmock.RegisterResponder("GET", "https://cert-manager.com/api/smime/v2/byPersonEmail/foobar%40test.de", httpmock.NewStringResponder(200, `[{ "id": 1, "state": "rejected", "certificateDetails": {}, "serialNumber": "", "orderNumber": 0, "backendCertId": null, "expires": null}]`)) | ||
logger, _ := zap.NewProduction() | ||
c := NewClient(http.DefaultClient, logger, "", "", "") | ||
list, err := c.ClientService.ListByEmail("[email protected]") | ||
assert.Nil(t, err) | ||
assert.Equal(t, 1, httpmock.GetTotalCallCount()) | ||
assert.Len(t, *list, 1) | ||
} | ||
func TestClientService_ListByEmail(t *testing.T) { | ||
httpmock.Activate() | ||
defer httpmock.DeactivateAndReset() | ||
|
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