PAN-15 Updated the gradle dependencies
This commit is contained in:
@@ -18,11 +18,16 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':persistence')
|
|
||||||
compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.11'
|
compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.11'
|
||||||
compile group: 'org.apache.httpcomponents', name: 'fluent-hc', version: '4.5.7'
|
compile group: 'org.apache.httpcomponents', name: 'fluent-hc', version: '4.5.7'
|
||||||
|
compile group: 'javax.persistence', name: 'javax.persistence-api', version: '2.2'
|
||||||
|
compile group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'
|
||||||
|
compile group: 'org.springframework.boot', name: 'spring-boot-autoconfigure', version: '2.1.3.RELEASE'
|
||||||
|
compile group: 'org.springframework.boot', name: 'spring-boot-devtools', version: '2.1.3.RELEASE'
|
||||||
|
compile group: 'org.springframework', name: 'spring-web', version: '5.1.5.RELEASE'
|
||||||
compile group: 'com.google.code.gson', name: 'gson', version: '2.7'
|
compile group: 'com.google.code.gson', name: 'gson', version: '2.7'
|
||||||
compile fileTree(dir: 'lib', include: '**/*.jar')
|
compile fileTree(dir: 'lib', include: '**/*.jar')
|
||||||
|
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||||
|
testCompile group: 'org.springframework', name: 'spring-test', version: '5.1.5.RELEASE'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package edu.msudenver.tsp.services.dto;
|
|||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
@@ -11,6 +12,7 @@ import java.io.Serializable;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class Account extends BaseDto implements Serializable {
|
public class Account extends BaseDto implements Serializable {
|
||||||
@Size(max = 50) private String username;
|
@Size(max = 50) private String username;
|
||||||
@Size(max = 256) private String password;
|
@Size(max = 256) private String password;
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
package edu.msudenver.tsp.services.parser;
|
package edu.msudenver.tsp.services.parser;
|
||||||
|
|
||||||
import edu.msudenver.tsp.persistence.controller.DefinitionController;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.InjectMocks;
|
import org.mockito.Spy;
|
||||||
import org.mockito.runners.MockitoJUnitRunner;
|
import org.mockito.runners.MockitoJUnitRunner;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -12,18 +11,12 @@ import java.util.List;
|
|||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.mockito.Matchers.anyString;
|
import static org.mockito.Matchers.anyString;
|
||||||
import static org.mockito.Mockito.mock;
|
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
@RunWith(MockitoJUnitRunner.class)
|
@RunWith(MockitoJUnitRunner.class)
|
||||||
public class ParserServiceTest {
|
public class ParserServiceTest {
|
||||||
|
|
||||||
private final DefinitionController definitionControllerMock = mock(DefinitionController.class);
|
@Spy private ParserService parserService;
|
||||||
private final ParserService mockParserService = mock(ParserService.class);
|
|
||||||
|
|
||||||
@InjectMocks
|
|
||||||
private final ParserService parserService = new ParserService(definitionControllerMock, null,
|
|
||||||
null, null);
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEmptyStringEqualsEmptyString() {
|
public void testEmptyStringEqualsEmptyString() {
|
||||||
@@ -106,8 +99,8 @@ public class ParserServiceTest {
|
|||||||
final List<String> expectedList = new ArrayList<>();
|
final List<String> expectedList = new ArrayList<>();
|
||||||
expectedList.add("");
|
expectedList.add("");
|
||||||
|
|
||||||
when(mockParserService.parseRawInput(anyString())).thenReturn(new Node("", null));
|
when(parserService.parseRawInput(anyString())).thenReturn(new Node("", null));
|
||||||
final List<String> actualList = parserService.retrieveStatements(mockParserService.parseRawInput(""));
|
final List<String> actualList = parserService.retrieveStatements(parserService.parseRawInput(""));
|
||||||
|
|
||||||
assertEquals(expectedList, actualList);
|
assertEquals(expectedList, actualList);
|
||||||
}
|
}
|
||||||
@@ -124,8 +117,8 @@ public class ParserServiceTest {
|
|||||||
testNode.setRight(new Node("then", testNode));
|
testNode.setRight(new Node("then", testNode));
|
||||||
testNode.getRight().setCenter(new Node(" x^2 is even", testNode.getRight()));
|
testNode.getRight().setCenter(new Node(" x^2 is even", testNode.getRight()));
|
||||||
|
|
||||||
when(mockParserService.parseRawInput(anyString())).thenReturn(testNode);
|
when(parserService.parseRawInput(anyString())).thenReturn(testNode);
|
||||||
final List<String> actualList = parserService.retrieveStatements(mockParserService.parseRawInput("baseCase"));
|
final List<String> actualList = parserService.retrieveStatements(parserService.parseRawInput("baseCase"));
|
||||||
|
|
||||||
assertEquals(expectedList, actualList);
|
assertEquals(expectedList, actualList);
|
||||||
}
|
}
|
||||||
@@ -133,8 +126,8 @@ public class ParserServiceTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testDriveParseUserInput() {
|
public void testDriveParseUserInput() {
|
||||||
final Node testNode = new Node("", null);
|
final Node testNode = new Node("", null);
|
||||||
when(mockParserService.parseRawInput(anyString())).thenReturn(testNode);
|
when(parserService.parseRawInput(anyString())).thenReturn(testNode);
|
||||||
when(mockParserService.retrieveStatements(testNode)).thenReturn(new ArrayList<>());
|
when(parserService.retrieveStatements(testNode)).thenReturn(new ArrayList<>());
|
||||||
|
|
||||||
final boolean successfulTestDrive = parserService.parseUserInput("");
|
final boolean successfulTestDrive = parserService.parseUserInput("");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user