(t *testing.T)
| 380 | } |
| 381 | |
| 382 | func TestInsertInvalidPEM(t *testing.T) { |
| 383 | dbAccessor, err := prepDB() |
| 384 | if err != nil { |
| 385 | t.Fatal(err) |
| 386 | } |
| 387 | |
| 388 | serialNumber, cert, _, signer, err := makeCertificate() |
| 389 | |
| 390 | if err != nil { |
| 391 | t.Fatal(err) |
| 392 | } |
| 393 | |
| 394 | resp, body := makeRequest(t, dbAccessor, signer, map[string]interface{}{ |
| 395 | "serial_number": serialNumber.Text(10), |
| 396 | "authority_key_identifier": hex.EncodeToString(cert.AuthorityKeyId), |
| 397 | "status": "good", |
| 398 | "pem": "this is not a PEM certificate", |
| 399 | "expiry": cert.NotAfter.UTC().Format(time.RFC3339), |
| 400 | }) |
| 401 | |
| 402 | if resp.StatusCode != http.StatusBadRequest { |
| 403 | t.Fatal("Expected HTTP Bad Request, got", resp.StatusCode, string(body)) |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | func TestInsertInvalidExpiry(t *testing.T) { |
| 408 | dbAccessor, err := prepDB() |
nothing calls this directly
no test coverage detected
searching dependent graphs…