aboutsummaryrefslogtreecommitdiffstats
path: root/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/persistence/ArchiveUriSerializerTest.java
blob: 84c286297890ab91a08435ff817a9b1b3a3d7041 (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 Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.provision.persistence;

import com.yahoo.config.provision.CloudAccount;
import com.yahoo.config.provision.TenantName;
import com.yahoo.vespa.hosted.provision.archive.ArchiveUris;
import org.junit.Test;

import java.util.Map;

import static org.junit.Assert.assertEquals;

/**
 * @author freva
 */
public class ArchiveUriSerializerTest {

    @Test
    public void test_serialization() {
        ArchiveUris archiveUris = new ArchiveUris(Map.of(
                    TenantName.from("tenant1"), "ftp://host123.test/dir/",
                    TenantName.from("tenant2"), "ftp://archive.test/vespa/"),
                Map.of(CloudAccount.from("321456987012"), "ftp://host123.test/dir/"));

        ArchiveUris serialized = ArchiveUriSerializer.fromJson(ArchiveUriSerializer.toJson(archiveUris));
        assertEquals(archiveUris, serialized);
    }

}