我的联系表单页面的一个测试用例是确保它始终在安全上下文中使用SSL。基本上,我想知道的是,我有一个给定的请求,其中
request.secure = true;
以下响应不包含任何关于此的信息,其头为空:@Test
public void shouldShowContactForm() {
Response response = GET("/contact");
// How can I ask the response, if the complete URL is in HTTPS?
}
即使我明确设置了自己的请求,我也找不到正确的方法来实现这一点:
@Test
public void shouldShowContactFormInSSLContext() {
Request request = newRequest();
request.secure = true;
Response response = GET(request, "/contact");
// Is it now possible?
}
这是否是测试的正确方法,或者我错过了请求/响应方面的重要内容?