aboutsummaryrefslogtreecommitdiffstats
path: root/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningThrottlerTest.java
blob: 609a05563ceba90ce6958c0509a2edd29d1d1284 (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
package com.yahoo.vespa.hosted.provision.provisioning;

import com.yahoo.vespa.hosted.provision.node.Agent;
import org.junit.jupiter.api.Test;

import static com.yahoo.vespa.hosted.provision.provisioning.ProvisioningThrottler.throttle;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
 * @author mpolden
 */
class ProvisioningThrottlerTest {

    @Test
    void throttling() {
        Agent agent = Agent.system;
        assertFalse(throttle(239, 10, agent));
        assertFalse(throttle(240, 10, agent));
        assertTrue(throttle(241, 10, agent));
    }

}