aboutsummaryrefslogtreecommitdiffstats
path: root/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/component/TestTaskContext.java
blob: de3fcee7e59b873c6ac28818aad9c4655565389a (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
31
32
33
34
35
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

package com.yahoo.vespa.hosted.node.admin.component;

import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

public class TestTaskContext implements TaskContext {
    private final List<String> systemModifications = new ArrayList<>();

    @Override
    public void recordSystemModification(Logger logger, String description) {
        systemModifications.add(description);
    }

    @Override
    public void log(Logger logger, Level level, String message) {
        logger.log(level, message);
    }

    @Override
    public void log(Logger logger, Level level, String message, Throwable throwable) {
        logger.log(level, message, throwable);
    }

    public List<String> getSystemModificationLog() {
        return systemModifications;
    }

    public void clearSystemModificationLog() {
        systemModifications.clear();
    }
}