http服务器规则
用于通过 HTTP 从类路径或文件系统提供文件的 JUnit4 规则
使用它
public class HttpServerRuleTest {
@Rule
public HttpServerRule server = HttpServerRule . builder()
.stopAfterStatement()
.build();
@Test
public void shouldServeClassPathByDefault () throws IOException {
HttpTransport client = new NetHttpTransport ();
String footxt = client . createRequestFactory()
.buildGetRequest
2021-06-11 11:05:47
14KB
Java
1