summaryrefslogtreecommitdiffstats
path: root/config-proxy/src/test/java/com/yahoo/vespa/config/proxy/MockRpcServer.java
blob: 6797072e200d3936d0e4c7e3878ea185e55876bc (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
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.proxy;

import com.yahoo.vespa.config.RawConfig;
import com.yahoo.vespa.config.protocol.JRTServerConfigRequest;

/**
 * @author hmusum
 */
public class MockRpcServer implements RpcServer {

    volatile long responses = 0;
    volatile long errorResponses = 0;

    public void returnOkResponse(JRTServerConfigRequest request, RawConfig config) {
        responses++;
    }

    public void returnErrorResponse(JRTServerConfigRequest request, int errorCode, String message) {
        responses++;
        errorResponses++;
    }
}