forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUsageTest.java
More file actions
27 lines (18 loc) · 854 Bytes
/
UsageTest.java
File metadata and controls
27 lines (18 loc) · 854 Bytes
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
package io.jooby;
import org.junit.jupiter.api.Test;
import java.lang.reflect.Method;
import static org.junit.jupiter.api.Assertions.assertEquals;
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) {
}
}