aboutsummaryrefslogtreecommitdiffstats
path: root/jdisc_core/src/test/java/com/yahoo/jdisc/test/NonWorkingRequestHandlerTestCase.java
blob: f826052eed7f61c093e5e90062cdc3a251c9e05f (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
36
37
38
39
40
41
42
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.test;

import com.yahoo.jdisc.handler.RequestHandler;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.fail;


/**
 * @author Simon Thoresen Hult
 */
public class NonWorkingRequestHandlerTestCase {

    @Test
    void requireThatHandleRequestThrowsException() {
        RequestHandler requestHandler = new NonWorkingRequestHandler();
        try {
            requestHandler.handleRequest(null, null);
            fail();
        } catch (UnsupportedOperationException e) {

        }
    }

    @Test
    void requireThatHandleTimeoutThrowsException() {
        RequestHandler requestHandler = new NonWorkingRequestHandler();
        try {
            requestHandler.handleTimeout(null, null);
            fail();
        } catch (UnsupportedOperationException e) {

        }
    }

    @Test
    void requireThatDestroyDoesNotThrow() {
        RequestHandler requestHandler = new NonWorkingRequestHandler();
        requestHandler.release();
    }
}