BAEL-1275 Introduction to ActiveWeb (#3638)
* BAEL-1275 Introduction to active web first commit * BAEL-1275 Added the module to parent pom * BAEL-1275 Introduction to ActiveWeb
This commit is contained in:
committed by
Grzegorz Piwowarek
parent
2399b4d817
commit
d7aecc83de
31
java-lite/src/test/java/app/controllers/ArticleControllerSpec.java
Executable file
31
java-lite/src/test/java/app/controllers/ArticleControllerSpec.java
Executable file
@@ -0,0 +1,31 @@
|
||||
package app.controllers;
|
||||
|
||||
import org.javalite.activeweb.ControllerSpec;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
|
||||
import app.services.ArticleServiceModule;
|
||||
|
||||
public class ArticleControllerSpec extends ControllerSpec {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
setInjector(Guice.createInjector(new ArticleServiceModule()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenReturnedArticlesThenCorrect() {
|
||||
request().get("index");
|
||||
a(responseContent()).shouldContain("<td>Introduction to Mule</td>");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenKeywordWhenFoundArticleThenCorrect() {
|
||||
request().param("key", "Java")
|
||||
.get("search");
|
||||
a(responseContent()).shouldContain("<td>Article with Java</td>");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user