blob: c1cdef6e4ee2849ed23516ca58bdabcc31d94506 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.persistence;
import com.yahoo.vespa.hosted.controller.api.integration.certificates.EndpointCertificate;
import com.yahoo.vespa.hosted.controller.certificate.UnassignedCertificate;
import org.junit.jupiter.api.Test;
import java.util.List;
import java.util.Optional;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* @author mpolden
*/
class UnassignedCertificateSerializerTest {
@Test
public void serialization() {
EndpointCertificate certificate = new EndpointCertificate("keyName", "certName", 1, 0,
"rootRequestId", Optional.of("leafRequestId"),
List.of("SAN1", "SAN2"), "issuer", Optional.of(3L),
Optional.of(4L), Optional.of("my-id"));
UnassignedCertificate unassignedCertificate = new UnassignedCertificate(certificate, UnassignedCertificate.State.ready);
UnassignedCertificateSerializer serializer = new UnassignedCertificateSerializer();
assertEquals(unassignedCertificate, serializer.fromSlime(serializer.toSlime(unassignedCertificate)));
}
}
|