package test;

import org.junit.*;

import play.mvc.*;
import play.test.*;
import play.libs.F.*;

import controllers.Interceptor;

import static play.test.Helpers.*;
import static org.fest.assertions.Assertions.*;

public class ApplicationTest {
    
    @Test 
    public void compute() {
        assertThat(1 + 1).isEqualTo(2);
    }

    @Test 
    public void test() {
        running(fakeApplication(), new Runnable() {
            public void run() {
                Result result = callAction(
                    controllers.routes.ref.JavaApi.headers(),
                    fakeRequest().withHeader(HOST, "playframework.org")
                );
                assertThat(contentAsString(result)).isEqualTo("playframework.org");
            }
        });
    }

    @Test
    public void interceptors() {
        Interceptor.state = "";
        Result result = callAction(controllers.routes.ref.JavaApi.notIntercepted());
        assertThat(contentAsString(result)).isEqualTo("");
        
        Interceptor.state = "";
        result = callAction(controllers.routes.ref.JavaApi.interceptedUsingWith());
        assertThat(contentAsString(result)).isEqualTo("intercepted");
        
        Interceptor.state = "";
        result = callAction(controllers.routes.ref.JavaApi.intercepted());
        assertThat(contentAsString(result)).isEqualTo("intercepted");
    }
}

@@ -803,24 +803,116 @@
 ceptors() %7B%0A
+        running(fakeApplication(), new Runnable() %7B%0A            public void run() %7B%0A        
         Inte
@@ -931,32 +931,40 @@
 e = %22%22;%0A        
+  
+      
 Result result = 
@@ -1016,32 +1016,40 @@
 Intercepted());%0A
+        
         assertTh
@@ -1095,33 +1095,43 @@
 %22);%0A        
-%0A
+        %0A  
         
 Interceptor.
@@ -1110,32 +1110,38 @@
      %0A          
+      
 Interceptor.stat
@@ -1148,32 +1148,40 @@
 e = %22%22;%0A        
+      
+  
 result = callAct
@@ -1236,24 +1236,32 @@
 ingWith());%0A
+        
         asse
@@ -1318,33 +1318,49 @@
 pted%22);%0A        
+ 
-%0A
+       %0A        
         Intercep
@@ -1367,32 +1367,40 @@
 tor.state = %22%22;%0A
+        
         result =
@@ -1458,32 +1458,40 @@
 ted());%0A        
+ 
+       
 assertThat(conte
@@ -1532,20 +1532,36 @@
 ercepted%22);%0A
+      %7D%7D);%0A    %0A
     %7D%0A%7D%0A

fix build