(t *testing.T)
| 117 | } |
| 118 | |
| 119 | func TestClientManagerGetMaxSizeExceeded(t *testing.T) { |
| 120 | manager := apns2.NewClientManager() |
| 121 | manager.MaxSize = 1 |
| 122 | cert1 := mockCert() |
| 123 | _ = manager.Get(cert1) |
| 124 | cert2, _ := certificate.FromP12File("certificate/_fixtures/certificate-valid.p12", "") |
| 125 | _ = manager.Get(cert2) |
| 126 | cert3, _ := certificate.FromP12File("certificate/_fixtures/certificate-valid-encrypted.p12", "password") |
| 127 | c := manager.Get(cert3) |
| 128 | assert.True(t, bytes.Equal(cert3.Certificate[0], c.Certificate.Certificate[0])) |
| 129 | assert.Equal(t, 1, manager.Len()) |
| 130 | } |
| 131 | |
| 132 | func TestClientManagerAdd(t *testing.T) { |
| 133 | fn := func(certificate tls.Certificate) *apns2.Client { |
nothing calls this directly
no test coverage detected