aboutsummaryrefslogtreecommitdiffstats
path: root/config-proxy/src/test/java/com/yahoo/vespa/config/proxy/MockRpcServer.java
blob: 56fcca191de31fb367afd5cfb93aba445d68111b (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 Yahoo. 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++;
    }
}