(t *testing.T)
| 355 | } |
| 356 | |
| 357 | func TestInsertInvalidStatus(t *testing.T) { |
| 358 | dbAccessor, err := prepDB() |
| 359 | if err != nil { |
| 360 | t.Fatal(err) |
| 361 | } |
| 362 | |
| 363 | serialNumber, cert, pemBytes, signer, err := makeCertificate() |
| 364 | |
| 365 | if err != nil { |
| 366 | t.Fatal(err) |
| 367 | } |
| 368 | |
| 369 | resp, body := makeRequest(t, dbAccessor, signer, map[string]interface{}{ |
| 370 | "serial_number": serialNumber.Text(10), |
| 371 | "authority_key_identifier": hex.EncodeToString(cert.AuthorityKeyId), |
| 372 | "status": "invalid", |
| 373 | "pem": string(pemBytes), |
| 374 | "expiry": cert.NotAfter.UTC().Format(time.RFC3339), |
| 375 | }) |
| 376 | |
| 377 | if resp.StatusCode != http.StatusBadRequest { |
| 378 | t.Fatal("Expected HTTP Bad Request", resp.StatusCode, string(body)) |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | func TestInsertInvalidPEM(t *testing.T) { |
| 383 | dbAccessor, err := prepDB() |
nothing calls this directly
no test coverage detected
searching dependent graphs…