(t *testing.T)
| 405 | } |
| 406 | |
| 407 | func TestInsertInvalidExpiry(t *testing.T) { |
| 408 | dbAccessor, err := prepDB() |
| 409 | if err != nil { |
| 410 | t.Fatal(err) |
| 411 | } |
| 412 | |
| 413 | serialNumber, cert, pemBytes, signer, err := makeCertificate() |
| 414 | |
| 415 | if err != nil { |
| 416 | t.Fatal(err) |
| 417 | } |
| 418 | |
| 419 | resp, body := makeRequest(t, dbAccessor, signer, map[string]interface{}{ |
| 420 | "serial_number": serialNumber.Text(10), |
| 421 | "authority_key_identifier": hex.EncodeToString(cert.AuthorityKeyId), |
| 422 | "status": "good", |
| 423 | "pem": string(pemBytes), |
| 424 | "expiry": "this is not an expiry", |
| 425 | }) |
| 426 | |
| 427 | if resp.StatusCode != http.StatusBadRequest { |
| 428 | t.Fatal("Expected HTTP Bad Request, got", resp.StatusCode, string(body)) |
| 429 | } |
| 430 | } |
| 431 | |
| 432 | func TestInsertWrongSerial(t *testing.T) { |
| 433 | dbAccessor, err := prepDB() |
nothing calls this directly
no test coverage detected
searching dependent graphs…