-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
Votes didn't exceed
-
+
within
-
+
-
+
-
+
diff --git a/spring-security-oauth/src/main/webapp/WEB-INF/jsp/submissionForm.jsp b/spring-security-oauth/src/main/webapp/WEB-INF/jsp/submissionForm.jsp
index 612d285504..a003186f73 100755
--- a/spring-security-oauth/src/main/webapp/WEB-INF/jsp/submissionForm.jsp
+++ b/spring-security-oauth/src/main/webapp/WEB-INF/jsp/submissionForm.jsp
@@ -1,13 +1,10 @@
-<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
-<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
-
Schedule to Reddit
-
+
-">
+
-
+
Post to Reddit
@@ -29,45 +26,46 @@ border-color: #ddd;
-
+
-
+
diff --git a/spring-security-oauth/src/main/webapp/WEB-INF/jsp/submissionResponse.jsp b/spring-security-oauth/src/main/webapp/WEB-INF/jsp/submissionResponse.jsp
index f4226c0aa4..9de779ea9d 100755
--- a/spring-security-oauth/src/main/webapp/WEB-INF/jsp/submissionResponse.jsp
+++ b/spring-security-oauth/src/main/webapp/WEB-INF/jsp/submissionResponse.jsp
@@ -1,17 +1,14 @@
-<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
-<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
-
Schedule to Reddit
-
+
-
+
-
${msg}
+Hello
\ No newline at end of file
diff --git a/spring-security-oauth/src/main/webapp/index.jsp b/spring-security-oauth/src/main/webapp/index.jsp
index 2c90a27733..51c283654a 100755
--- a/spring-security-oauth/src/main/webapp/index.jsp
+++ b/spring-security-oauth/src/main/webapp/index.jsp
@@ -1,11 +1,9 @@
-
-<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
Schedule to Reddit
-
+
diff --git a/spring-security-oauth/src/test/java/org/baeldung/classifier/RedditClassifierTest.java b/spring-security-oauth/src/test/java/org/baeldung/classifier/RedditClassifierTest.java
index d72a689253..6b51c852c7 100644
--- a/spring-security-oauth/src/test/java/org/baeldung/classifier/RedditClassifierTest.java
+++ b/spring-security-oauth/src/test/java/org/baeldung/classifier/RedditClassifierTest.java
@@ -6,9 +6,10 @@ import java.io.IOException;
import org.baeldung.reddit.classifier.RedditClassifier;
import org.baeldung.reddit.classifier.RedditDataCollector;
+import org.junit.Ignore;
import org.junit.Test;
-//@Ignore
+@Ignore
public class RedditClassifierTest {
@Test
diff --git a/spring-security-oauth/src/test/java/org/baeldung/persistence/PersistenceJPATest.java b/spring-security-oauth/src/test/java/org/baeldung/persistence/PersistenceJPATest.java
index a025d171b3..9b6591497c 100644
--- a/spring-security-oauth/src/test/java/org/baeldung/persistence/PersistenceJPATest.java
+++ b/spring-security-oauth/src/test/java/org/baeldung/persistence/PersistenceJPATest.java
@@ -8,13 +8,11 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;
-import org.baeldung.config.PersistenceJPAConfig;
import org.baeldung.persistence.dao.PostRepository;
import org.baeldung.persistence.dao.UserRepository;
import org.baeldung.persistence.model.Post;
import org.baeldung.persistence.model.User;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
@@ -24,10 +22,10 @@ import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.transaction.annotation.Transactional;
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(classes = { PersistenceJPAConfig.class })
+@ContextConfiguration(classes = { TestJPAConfig.class })
@Transactional
@TransactionConfiguration
-@Ignore
+// @Ignore
public class PersistenceJPATest {
@Autowired
private PostRepository postRepository;
diff --git a/spring-security-oauth/src/test/java/org/baeldung/persistence/TestJPAConfig.java b/spring-security-oauth/src/test/java/org/baeldung/persistence/TestJPAConfig.java
new file mode 100644
index 0000000000..a3d29d7424
--- /dev/null
+++ b/spring-security-oauth/src/test/java/org/baeldung/persistence/TestJPAConfig.java
@@ -0,0 +1,73 @@
+package org.baeldung.persistence;
+
+import java.util.Properties;
+
+import javax.sql.DataSource;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.core.env.Environment;
+import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+import org.springframework.orm.jpa.JpaTransactionManager;
+import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
+import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+@Configuration
+@EnableTransactionManagement
+@PropertySource({ "classpath:persistence-test.properties" })
+@ComponentScan({ "org.baeldung.persistence.model", "org.baeldung.persistence.dao" })
+@EnableJpaRepositories(basePackages = "org.baeldung.persistence.dao")
+public class TestJPAConfig {
+ @Autowired
+ private Environment env;
+
+ public TestJPAConfig() {
+ super();
+ }
+
+ @Bean
+ public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
+ final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
+ em.setDataSource(dataSource());
+ em.setPackagesToScan(new String[] { "org.baeldung.persistence.model" });
+ final HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
+ em.setJpaVendorAdapter(vendorAdapter);
+ em.setJpaProperties(additionalProperties());
+ return em;
+ }
+
+ @Bean
+ public DataSource dataSource() {
+ final DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(env.getProperty("jdbc.driverClassName"));
+ dataSource.setUrl(env.getProperty("jdbc.url"));
+ dataSource.setUsername(env.getProperty("jdbc.user"));
+ dataSource.setPassword(env.getProperty("jdbc.pass"));
+ return dataSource;
+ }
+
+ @Bean
+ public JpaTransactionManager transactionManager() {
+ final JpaTransactionManager transactionManager = new JpaTransactionManager();
+ transactionManager.setEntityManagerFactory(entityManagerFactory().getObject());
+ return transactionManager;
+ }
+
+ @Bean
+ public PersistenceExceptionTranslationPostProcessor exceptionTranslation() {
+ return new PersistenceExceptionTranslationPostProcessor();
+ }
+
+ final Properties additionalProperties() {
+ final Properties hibernateProperties = new Properties();
+ hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto", "create-drop"));
+ hibernateProperties.setProperty("hibernate.dialect", env.getProperty("hibernate.dialect"));
+ return hibernateProperties;
+ }
+}