aboutsummaryrefslogtreecommitdiffstats
path: root/athenz-identity-provider-service/src/test/java/com/yahoo/vespa/hosted/ca/restapi/mock/InstanceValidatorMock.java
blob: 4151c1f15d7e0d1c030d050551b25ce8e32829d1 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.ca.restapi.mock;

import com.yahoo.vespa.hosted.athenz.instanceproviderservice.InstanceConfirmation;
import com.yahoo.vespa.hosted.athenz.instanceproviderservice.InstanceValidator;

/**
 * @author mortent
 */
public class InstanceValidatorMock extends InstanceValidator {

    public InstanceValidatorMock() {
        super(null, null, null, null, null);
    }

    @Override
    public boolean isValidInstance(InstanceConfirmation instanceConfirmation) {
        return instanceConfirmation.attributes.get(SAN_DNS_ATTRNAME) != null &&
               instanceConfirmation.attributes.get(SAN_IPS_ATTRNAME) != null;
    }

    @Override
    public boolean isValidRefresh(InstanceConfirmation confirmation) {
        return confirmation.attributes.get(SAN_DNS_ATTRNAME) != null &&
               confirmation.attributes.get(SAN_IPS_ATTRNAME) != null;
    }
}