22import com .blockscore .models .WatchlistCandidate ;
33import com .blockscore .models .results .WatchlistHit ;
44import com .blockscore .net .BlockscoreApiClient ;
5+ import edu .umd .cs .findbugs .annotations .SuppressFBWarnings ;
56import org .jetbrains .annotations .NotNull ;
67import org .jetbrains .annotations .Nullable ;
78import org .junit .Assert ;
1718 * Created by Tony Dieppa on 9/30/14.
1819 */
1920public 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