blob: 6a089c5e1b0e85ade14405b790b8829aa21c3f4b (
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
|
// Copyright 2020 Oath Inc. 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.config.provision.zone.ZoneId;
import com.yahoo.vespa.hosted.controller.routing.GlobalRouting;
import com.yahoo.vespa.hosted.controller.routing.ZoneRoutingPolicy;
import org.junit.Test;
import java.time.Instant;
import static org.junit.Assert.assertEquals;
/**
* @author mpolden
*/
public class ZoneRoutingPolicySerializerTest {
@Test
public void serialization() {
var serializer = new ZoneRoutingPolicySerializer(new RoutingPolicySerializer());
var zone = ZoneId.from("prod", "us-north-1");
var policy = new ZoneRoutingPolicy(zone,
GlobalRouting.status(GlobalRouting.Status.out, GlobalRouting.Agent.operator,
Instant.ofEpochMilli(123)));
var serialized = serializer.fromSlime(zone, serializer.toSlime(policy));
assertEquals(policy, serialized);
}
}
|