PAN-7 Cleaned up the gradle files
This commit is contained in:
@@ -17,7 +17,6 @@ dependencies {
|
||||
compile group: 'org.springframework.data', name: 'spring-data-jpa', version: '2.0.5.RELEASE'
|
||||
compile group: 'org.apache.tomcat', name: 'tomcat-jdbc', version: '9.0.16'
|
||||
compile group: 'org.springframework.boot', name: 'spring-boot-devtools', version: '2.0.5.RELEASE'
|
||||
// compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-elasticsearch', version: '2.1.2.RELEASE'
|
||||
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.0.5.RELEASE'
|
||||
compile group: 'org.springframework', name: 'spring-aspects', version: '5.1.5.RELEASE'
|
||||
compile group: 'org.hibernate', name: 'hibernate-core', version: '5.4.1.Final'
|
||||
@@ -27,7 +26,6 @@ dependencies {
|
||||
compile fileTree(dir: 'lib', include: '**/*.jar')
|
||||
|
||||
compile group: 'mysql', name: 'mysql-connector-java', version: '8.0.15'
|
||||
// compile 'javax.validation:validation-api:1.1.0.Final'
|
||||
compile('com.googlecode.log4jdbc:log4jdbc:1.2') {
|
||||
exclude(group: 'org.slf4j')
|
||||
}
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package edu.msudenver.tsp.persistence;
|
||||
|
||||
import edu.msudenver.tsp.persistence.dto.Definition;
|
||||
import edu.msudenver.tsp.persistence.dto.DefinitionDto;
|
||||
import edu.msudenver.tsp.persistence.dto.Notation;
|
||||
import edu.msudenver.tsp.persistence.repository.DefinitionRepository;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DefinitionsIntegrationTest {
|
||||
private final DefinitionRepository definitionRepository;
|
||||
|
||||
@Autowired DefinitionsIntegrationTest(final DefinitionRepository definitionRepository) {
|
||||
this.definitionRepository = definitionRepository;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCRUDFunctionality() {
|
||||
// Create a new definition
|
||||
final DefinitionDto definitionDto = createDefinition();
|
||||
final DefinitionDto savedDefinition = definitionRepository.save(definitionDto);
|
||||
}
|
||||
|
||||
private DefinitionDto createDefinition() {
|
||||
final List<String> definitionList = new ArrayList<>();
|
||||
definitionList.add("testDefinition1");
|
||||
|
||||
final Definition definition = new Definition();
|
||||
definition.setDefinitions(definitionList);
|
||||
|
||||
final List<String> notationList = new ArrayList<>();
|
||||
notationList.add("\\textLaTeX");
|
||||
|
||||
final Notation notation = new Notation();
|
||||
notation.setNotations(notationList);
|
||||
|
||||
final DefinitionDto definitionDto = new DefinitionDto();
|
||||
definitionDto.setDefinition(definition);
|
||||
definitionDto.setNotation(notation);
|
||||
|
||||
return definitionDto;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -80,7 +80,7 @@ public class PersistenceApi {
|
||||
@Bean(name = "sessionFactory")
|
||||
public SessionFactory getSessionFactory(final DataSource dataSource) {
|
||||
final LocalSessionFactoryBuilder sessionFactoryBuilder = new LocalSessionFactoryBuilder(dataSource);
|
||||
sessionFactoryBuilder.scanPackages("edu.msudenver.tsp.persistence.entity");
|
||||
sessionFactoryBuilder.scanPackages("edu.msudenver.tsp.persistence.dto");
|
||||
return sessionFactoryBuilder.buildSessionFactory();
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -9,7 +9,7 @@ import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EntityListeners;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -19,8 +19,8 @@ import java.io.Serializable;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DefinitionDto extends BaseDto implements Serializable {
|
||||
@NotBlank(groups = Insert.class) @Size(min = 1, max = 200, message = "Must be between 1 and 200 characters") private String name;
|
||||
@NotBlank(groups = Insert.class) @Type(type = "json") @Column(columnDefinition = "jsonb") private Definition definition;
|
||||
@NotNull(groups = Insert.class) @Size(min = 1, max = 200, message = "Must be between 1 and 200 characters") private String name;
|
||||
@NotNull(groups = Insert.class) @Type(type = "json") @Column(columnDefinition = "jsonb") private Definition definition;
|
||||
@Type(type = "json") @Column(columnDefinition = "jsonb") private Notation notation;
|
||||
|
||||
public static final long serialVersionUID = -5314619286352932857L;
|
||||
|
||||
@@ -9,5 +9,5 @@ spring.jpa.show-sql = true
|
||||
spring.datasource.tomcat.test-while-idle=true
|
||||
spring.datasource.tomcat.validation-query=SELECT 1
|
||||
logging.level.org.springframework.web=DEBUG
|
||||
spring.datasource.tomcat.max-active=1
|
||||
spring.datasource.tomcat.max-active=5
|
||||
server.port=8090
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
package edu.msudenver.tsp.website;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class HelloControllerTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
assertEquals(3, 3);
|
||||
}
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package edu.msudenver.tsp.website.integrationTest;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class HelloControllerIntegrationTest {
|
||||
@Test
|
||||
public void test() {
|
||||
assertEquals(3,3);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user