AuraContext context = Aura.getContextService().getCurrentContext();
DefDescriptor<ApplicationDef> desc = addSourceAutoCleanup(ApplicationDef.class,
"<aura:application render='client' useAppcache='true'></aura:application>");
context.setApplicationDescriptor(desc);
final String uid = context.getDefRegistry().getUid(null, desc);
context.addLoaded(desc, uid);
String body = doWrite(desc.getDef());
int start = body.indexOf("<html");
String tag = body.substring(start, body.indexOf('>', start) + 1);
String expectedSubPath = AuraTextUtil.urlencode(String.format(
"{\"mode\":\"UTEST\",\"app\":\"%s\",\"loaded\":{\"APPLICATION@%s\":\"%s\"},\"test\":\"%s\"}",