blob: e70fc184b8784474a50c4dbca43a9592666c87bc (
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 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.provision.lb;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.config.provision.HostName;
import org.junit.Test;
import java.util.Set;
import static org.junit.Assert.assertEquals;
/**
* @author mpolden
*/
public class PassthroughLoadBalancerServiceTest {
@Test
public void create() {
var lbService = new PassthroughLoadBalancerService();
var real = new Real(HostName.from("host1.example.com"), "192.0.2.10");
var reals = Set.of(real, new Real(HostName.from("host2.example.com"), "192.0.2.11"));
var instance = lbService.create(ApplicationId.from("tenant1", "app1", "default"),
ClusterSpec.Id.from("c1"), reals, false, null);
assertEquals(real.hostname(), instance.hostname());
assertEquals(Set.of(real.port()), instance.ports());
assertEquals(Set.of(real.ipAddress() + "/32"), instance.networks());
}
}
|