DefDescriptor<ApplicationDef> nopreload = DefDescriptorImpl.getInstance("appCache:nopreload",
ApplicationDef.class);
Aura.getContextService().getCurrentContext().setApplicationDescriptor(nopreload);
DummyHttpServletRequest request = new DummyHttpServletRequest();
DummyHttpServletResponse response = new DummyHttpServletResponse() {
Cookie cookie;
@Override
public void addCookie(Cookie cookie) {
this.cookie = cookie;
}
@Override
public Cookie getCookie(String name) {
return cookie != null && cookie.getName().equals(name) ? cookie : null;
}
};
ManifestUtil.checkManifestCookie(request, response);
String expectedName = Mode.UTEST + "_" + nopreload.getNamespace() + "_" + nopreload.getName() + "_lm";
Cookie cookie = response.getCookie(expectedName);
assertEquals(expectedName, cookie.getName());
//
// Format of the cookie is now <n>:<time>
//
assertEquals(AuraBaseServlet.SHORT_EXPIRE_SECONDS, cookie.getMaxAge());