Merge branch 'master' into PAN-15

This commit is contained in:
Alex Tusa
2019-03-20 22:15:08 -06:00
committed by GitHub
42 changed files with 1954 additions and 383 deletions
@@ -57,6 +57,10 @@ public class RestService {
return send(requestFactory.put(uri, requestJson), null, connectionTimeout, socketTimeout, type);
}
<T> Optional<T> patch(final String uri, final String requestJson, final TypeToken<T> type, final Integer connectionTimeout, final Integer socketTimeout) {
LOG.info("Sending PATCH {} with body: {}", uri, requestJson);
return send(requestFactory.patch(uri, requestJson), null, connectionTimeout, socketTimeout, type);
}
private <T> Optional<T> send(final Request request, final String auth, final Integer connectionTimeout, final Integer socketTimeout, final TypeToken<T> type) {
try {
@@ -21,5 +21,4 @@ public class Account extends BaseDto implements Serializable {
private static final long serialVersionUID = 7095627971593953734L;
}
@@ -1,23 +1,24 @@
package edu.msudenver.tsp.services.parser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@Service
class ParserService {
private Node root;
public boolean parseUserInput(final String userInput)
{
try {
final Node tree = parseRawInput(userInput);
final List<String> statements = retrieveStatements(tree);
retrieveStatements(tree);
return true;
} catch(final Exception e) {
e.printStackTrace();
LOG.error(e.getMessage());
}
return false;
}
@@ -26,7 +27,7 @@ class ParserService {
{
input = input.toLowerCase();
root = new Node(input, null);
final Node root = new Node(input, null);
if(input.equals(""))
{
@@ -1,16 +0,0 @@
package edu.msudenver.tsp.services.scoring;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan
//@PropertySource("classpath:development.properties")
public class ScoringConfig {
@Bean
public TheoremScoringService theoremScoringService() {
return new TheoremScoringService();
}
}
@@ -1,8 +0,0 @@
package edu.msudenver.tsp.services.scoring;
import org.springframework.stereotype.Service;
@Service
class TheoremScoringService {
}
@@ -0,0 +1,66 @@
package edu.msudenver.tsp.services.factory;
import org.apache.http.client.fluent.Request;
import org.junit.Test;
import static org.junit.Assert.assertNotNull;
public class RequestFactoryTest {
private final RequestFactory requestFactory = new RequestFactory();
@Test
public void testDelete() {
final Request testRequest = requestFactory.delete("testUri");
assertNotNull(testRequest);
}
@Test
public void testGet() {
final Request testRequest = requestFactory.get("testUri");
assertNotNull(testRequest);
}
@Test
public void testPost() {
final Request testRequest = requestFactory.post("testUri", "testJson");
assertNotNull(testRequest);
}
@Test
public void testPost_blankRequestJson() {
final Request testRequest = requestFactory.post("testUri", null);
assertNotNull(testRequest);
}
@Test
public void testPut() {
final Request testRequest = requestFactory.put("testUri", "testJson");
assertNotNull(testRequest);
}
@Test
public void testPut_blankRequestJson() {
final Request testRequest = requestFactory.put("testUri", null);
assertNotNull(testRequest);
}
@Test
public void testPatch() {
final Request testRequest = requestFactory.patch("testUri", "testJson");
assertNotNull(testRequest);
}
@Test
public void testPatch_blankRequestJson() {
final Request testRequest = requestFactory.patch("testUri", null);
assertNotNull(testRequest);
}
}
@@ -2,7 +2,8 @@ package edu.msudenver.tsp.services.parser;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Spy;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import java.util.ArrayList;
@@ -16,7 +17,8 @@ import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
public class ParserServiceTest {
@Spy private ParserService parserService;
@Mock private ParserService mockParserService;
@InjectMocks private ParserService parserService;
@Test
public void testEmptyStringEqualsEmptyString() {
@@ -1,16 +0,0 @@
package edu.msudenver.tsp.services.scoring;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
import static org.junit.Assert.assertEquals;
@RunWith(MockitoJUnitRunner.class)
public class TheoremScoringServiceTest {
@Test
public void test() {
assertEquals(3,3);
}
}