Merge pull request #8125 from eugenp/revert-8119-BAEL-3275-2

Revert "BAEL-3275: Using blocking queue for pub-sub"
This commit is contained in:
Eric Martin
2019-10-31 20:43:47 -05:00
committed by GitHub
parent db85c8f275
commit 3225470df5
20543 changed files with 1642750 additions and 0 deletions
@@ -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"));
}
}