[JAVA-13854] Half list moved (#12598)
* [JAVA-13854] added parent module * [JAVA-13854] moved apache-tapestry(submodule) to web-modules(parent) * [JAVA-13854] moved bootique(submodule) to web-modules(parent) * [JAVA-13854] moved dropwizard(submodule) to web-modules(parent) * [JAVA-13854] moved blade(submodule) to web-modules(parent) * [JAVA-13854] moved java-lite(submodule) to web-modules(parent) * [JAVA-13854] moved jooby(submodule) to web-modules(parent) * [JAVA-13854] moved linkrest(submodule) to web-modules(parent) * [JAVA-13854] moved ninja(submodule) to web-modules(parent) * [JAVA-13854] moved ratpack(submodule) to web-modules(parent) * [JAVA-13854] moved resteasy(submodule) to web-modules(parent) * [JAVA-13854] moved restx(submodule) to web-modules(parent) * [JAVA-13854] moved spark-java(submodule) to web-modules(parent) * [JAVA-13854] moved vraptor(submodule) to web-modules(parent) * [JAVA-13854] delete modules that were moved * [JAVA-13854] * [JAVA-13854] * [JAVA-13854] delete ninja submodule + moved raml(submodule) to web-modules(parent) * [JAVA-13854] moved gwt(submodule) to web-modules(parent) * [JAVA-13854] moved jakarta-ee(submodule) to web-modules(parent) * [JAVA-13854] moved javax-servlets(submodule) to web-modules(parent) * [JAVA-13854] moved javax-servlets-2(submodule) to web-modules(parent) * [JAVA-13854] moved jee-7(submodule) to web-modules(parent) * [JAVA-13854] moved play-framework(not a module) to web-modules * [JAVA-13854] fix failing test * [JAVA-13854] moved struts-2(submodule) to web-modules(parent) * [JAVA-13854] moved wicket(submodule) to web-modules(parent) * [JAVA-13854] deleted modules that were moved to web-modules * JAVA-13854 Removed moved modules from the main pom.xml Co-authored-by: panagiotiskakos <panagiotis.kakos@libra-is.com> Co-authored-by: Dhawal Kapil <dhawalkapil@gmail.com>
This commit is contained in:
@@ -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>");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package app.models;
|
||||
|
||||
import org.javalite.activejdbc.Base;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class ProductUnitTest {
|
||||
|
||||
//@Test
|
||||
public void givenSavedProduct_WhenFindFirst_ThenSavedProductIsReturned() {
|
||||
//Open DB connection
|
||||
Base.open("com.mysql.jdbc.Driver", "jdbc:mysql://localhost/dbname", "user", "password");
|
||||
|
||||
//Create a product and save it
|
||||
Product toSaveProduct = new Product();
|
||||
toSaveProduct.set("name", "Bread");
|
||||
toSaveProduct.saveIt();
|
||||
|
||||
//Find product
|
||||
Product savedProduct = Product.findFirst("name = ?", "Bread");
|
||||
|
||||
Assert.assertEquals(toSaveProduct.get("name"), savedProduct.get("name"));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user