Skip to content

Commit 66dc05b

Browse files
committed
Tweaked build for tests
1 parent f10ee4a commit 66dc05b

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ dependencies {
3030

3131
//Used for static analysis
3232
compile 'com.intellij:annotations:+'
33+
compile 'com.google.code.findbugs:annotations:+'
3334

3435
//Used for testing only.
3536
testCompile 'junit:junit:+'
@@ -55,4 +56,6 @@ tasks.withType(FindBugs) {
5556
xml.enabled = false;
5657
html.enabled = true;
5758
}
58-
}
59+
}
60+
61+
checkstyleTest.exclude '**/src/test/**'

src/test/java/CompanyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private Company createTestCompany() throws ParseException {
8282
return company.setEntityName("BlockScore").setTaxId("123410000").setIncorpDate(date)
8383
.setIncorpState("DE").setIncorpCountryCode("US").setIncorpType(CorporationType.CORP)
8484
.setDbas("BitRemit").setRegNumber("123123123").setEmail("[email protected]")
85-
.setURL("https://blockscore.com").setPhoneNumber("6505555555").setIPAddress("67.160.8.182")
85+
.setURL("https://blockscore.com").setPhoneNumber("6505555555")
8686
.setAddress(address);
8787
}
8888

src/test/java/VerificationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.blockscore.models.request.QuestionSetRequest;
55
import com.blockscore.models.results.Verification;
66
import com.blockscore.net.BlockscoreApiClient;
7+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
78
import org.jetbrains.annotations.NotNull;
89
import org.jetbrains.annotations.Nullable;
910
import org.junit.Assert;
@@ -151,6 +152,7 @@ public void scoreQuestionSetWithNoAnswers() throws ParseException {
151152
Assert.assertNotNull(exception);
152153
}
153154

155+
@SuppressFBWarnings(value = {"DLS"})
154156
@Test
155157
public void scoreQuestionSetWithBadAnswers() throws ParseException {
156158
InvalidRequestException exception = null;

src/test/java/WatchlistTest.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import com.blockscore.models.WatchlistCandidate;
33
import com.blockscore.models.results.WatchlistHit;
44
import com.blockscore.net.BlockscoreApiClient;
5+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
56
import org.jetbrains.annotations.NotNull;
67
import org.jetbrains.annotations.Nullable;
78
import org.junit.Assert;
@@ -17,10 +18,10 @@
1718
* Created by Tony Dieppa on 9/30/14.
1819
*/
1920
public class WatchlistTest {
20-
private static final SimpleDateFormat FORMATTER = new SimpleDateFormat("yyyy-MM-dd");
2121

2222
@Test
2323
public void watchListTest() throws ParseException {
24+
final SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
2425
BlockscoreApiClient apiClient = setupBlockscoreApiClient();
2526

2627
//Tests creation of a candidate
@@ -29,7 +30,7 @@ public void watchListTest() throws ParseException {
2930

3031
//Tests updating a candidate.
3132
WatchlistCandidate candidateUpdate = new WatchlistCandidate();
32-
Date date = FORMATTER.parse("1986-08-23");
33+
Date date = formatter.parse("1986-08-23");
3334
candidateUpdate.setNote("1234123").setSSN("002").setDateOfBirth(date).setFirstName("Jack")
3435
.setLastName("Sparrow").setStreet1("1 Infinite Sea").setCity("Atlantis").setCountryCode("US");
3536
candidate = apiClient.updateWatchlistCandidate(candidate.getId(), candidateUpdate).toBlocking().first();
@@ -57,6 +58,7 @@ public void watchListTest() throws ParseException {
5758
isCandidateValid(candidate);
5859
}
5960

61+
@SuppressFBWarnings(value = {"DLS"})
6062
@Test
6163
public void badCandidateCreationTest() throws ParseException {
6264
InvalidRequestException exception = null;
@@ -160,8 +162,9 @@ public void deleteNonexistentCandidateTest() {
160162
*/
161163
@NotNull
162164
private WatchlistCandidate createTestCandidate() throws ParseException {
165+
final SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
163166
WatchlistCandidate candidate = new WatchlistCandidate();
164-
Date date = FORMATTER.parse("1980-08-23");
167+
Date date = formatter.parse("1980-08-23");
165168
candidate.setNote("12341234").setSSN("001").setDateOfBirth(date).setFirstName("John")
166169
.setLastName("BredenKamp").setStreet1("1 Infinite Loop").setCity("Harare").setCountryCode("ZW");
167170
return candidate;
@@ -201,11 +204,12 @@ private void areCandidatesValid(@Nullable final List<WatchlistCandidate> candida
201204
* @param candidate Candidate under test.
202205
* @throws ParseException
203206
*/
204-
private void didCandidateDataUpdate(@Nullable final WatchlistCandidate candidate) throws ParseException {
207+
private void didCandidateDataUpdate(@NotNull final WatchlistCandidate candidate) throws ParseException {
208+
final SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
205209
isCandidateValid(candidate);
206210
Assert.assertEquals(candidate.getSSN(), "002");
207211
Assert.assertEquals(candidate.getNote(), "1234123");
208-
Assert.assertEquals(candidate.getDateOfBirth(), FORMATTER.parse("1986-08-23"));
212+
Assert.assertEquals(candidate.getDateOfBirth(), formatter.parse("1986-08-23"));
209213
Assert.assertEquals(candidate.getFirstName(), "Jack");
210214
Assert.assertEquals(candidate.getLastName(), "Sparrow");
211215
Assert.assertEquals(candidate.getStreet1(), "1 Infinite Sea");

0 commit comments

Comments
 (0)