Move principal expiry into body of test

pull/2446/head
Michael Desa 2017-12-05 14:31:26 -05:00
parent 87dcb3cfcd
commit a245dd7c38
1 changed files with 4 additions and 4 deletions

View File

@ -66,8 +66,6 @@ func TestServer(t *testing.T) {
Organization: "0",
Subject: "billibob",
Issuer: "github",
ExpiresAt: time.Now().Add(10 * time.Second),
IssuedAt: time.Now(),
},
},
wants: wants{
@ -106,8 +104,6 @@ func TestServer(t *testing.T) {
Organization: "0",
Subject: "billibob",
Issuer: "github",
ExpiresAt: time.Now().Add(10 * time.Second),
IssuedAt: time.Now(),
},
},
wants: wants{
@ -238,6 +234,10 @@ func TestServer(t *testing.T) {
}
}
// Set the Expiry time on the principal
tt.args.principal.IssuedAt = time.Now()
tt.args.principal.ExpiresAt = time.Now().Add(10 * time.Second)
// Construct HTTP Request
buf, _ := json.Marshal(tt.args.payload)
reqBody := ioutil.NopCloser(bytes.NewReader(buf))