-
-
Notifications
You must be signed in to change notification settings - Fork 200
Expand file tree
/
Copy pathUsageTest.java
More file actions
34 lines (27 loc) · 1.02 KB
/
UsageTest.java
File metadata and controls
34 lines (27 loc) · 1.02 KB
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
/*
* Jooby https://jooby.io
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
* Copyright 2014 Edgar Espina
*/
package io.jooby;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.lang.reflect.Method;
import org.junit.jupiter.api.Test;
public class UsageTest {
static {
System.setProperty("jooby.host", "http://localhost:4000");
}
@Test
public void parameterNameMissing() throws NoSuchMethodException {
Method method = getClass().getDeclaredMethod("parameterMissing", String.class);
Usage usage = Usage.parameterNameNotPresent(method.getParameters()[0]);
assertEquals(
"Unable to provision parameter at position: '0', require by: method"
+ " io.jooby.UsageTest.parameterMissing(java.lang.String). Parameter's name is"
+ " missing\n"
+ "For more details, please visit:"
+ " http://localhost:4000/usage#bean-converter-parameter-name-missing",
usage.getMessage());
}
public void parameterMissing(String some) {}
}