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
31
32
33
34
35
36
37
|
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.integration;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.vespa.hosted.controller.api.integration.deployment.ApplicationStore;
import java.util.HashMap;
import java.util.Map;
public class ApplicationStoreMock implements ApplicationStore {
Map<String, byte[]> store = new HashMap<>();
@Override
public byte[] getApplicationPackage(ApplicationId application, String applicationVersion) {
return store.get(path(application, applicationVersion));
}
@Override
public void putApplicationPackage(ApplicationId application, String applicationVersion, byte[] applicationPackage) {
store.put(path(application, applicationVersion), applicationPackage);
}
@Override
public void putTesterPackage(ApplicationId tester, String applicationVersion, byte[] testerPackage) {
store.put(path(tester, applicationVersion), testerPackage);
}
@Override
public byte[] getTesterPackage(ApplicationId tester, String applicationVersion) {
return store.get(path(tester, applicationVersion));
}
String path(ApplicationId tester, String applicationVersion) {
return tester.toString() + applicationVersion;
}
}
|