EndpointsTest.java 文件源码

java
阅读 36 收藏 0 点赞 0 评论 0

项目:stock-api-sdk 作者:
@Test(groups = "Endpoints.getSearchFilesEndpoint")
public void getSearchFilesEndpoint_should_throw_stockexception_since_the_endpoint_properties_file_is_missing() {
    PowerMockito.spy(Endpoints.class);

    try {
        PowerMockito.doReturn(null).when(Endpoints.class,
                "getResourceAsStream", Mockito.any(String.class));
    } catch (Exception e1) {
        Assert.fail(
                "Couldn't mock the Endpoints.getResourceAsStream method!",
                e1);
    }

    try {
        new Endpoints(Environment.STAGE);

        Assert.fail("Didn't expect the endpoints to get constructed without exception!");
    } catch (StockException e) {
        Assert.assertEquals(e.getMessage(),
                "Could not load the endpoint properties file");
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号