File tree Expand file tree Collapse file tree 2 files changed +18
-12
lines changed
main/java/com/blockscore/models
test/java/com/blockscore/models Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -161,8 +161,14 @@ public PaginatedResult<WatchlistHit> searchWatchlists(EntityType entityType) {
161161 public PaginatedResult <WatchlistHit > searchWatchlists (EntityType entityType , Double similarityThreshold ) {
162162 Map <String , String > queryOptions = new HashMap <String , String >();
163163 queryOptions .put ("candidate_id" , getId ());
164- queryOptions .put ("match_type" , String .valueOf (entityType ));
165- queryOptions .put ("similarity_threshold" , String .valueOf (similarityThreshold ));
164+
165+ if (entityType != null ) {
166+ queryOptions .put ("match_type" , String .valueOf (entityType ));
167+ }
168+
169+ if (similarityThreshold != null ) {
170+ queryOptions .put ("similarity_threshold" , String .valueOf (similarityThreshold ));
171+ }
166172
167173 WatchlistSearchResults results = restAdapter .searchWatchlists (queryOptions );
168174
Original file line number Diff line number Diff line change @@ -75,8 +75,16 @@ public void testCompanyRetrieval_InvalidId() {
7575
7676 @ Test
7777 public void testCompanyListing () {
78- PaginatedResult <Company > companies = client .listCompanies ();
79- assertCompaniesAreValid (companies .getData ());
78+ for (Company company : client .listCompanies ().getData ()) {
79+ assertBasicResponseIsValid (company );
80+ assertNotNull (company .getId ());
81+ assertNotNull (company .getEntityName ());
82+ assertNotNull (company .getTaxId ());
83+ assertNotNull (company .getIncorporationCountryCode ());
84+ assertNotNull (company .getIncorporationType ());
85+ assertDetailsAreValid (company .getDetails ());
86+ assertAddressIsValid (company .getAddress ());
87+ }
8088 }
8189
8290 /*------------------*/
@@ -176,12 +184,4 @@ private void assertDetailsAreValid(final CompanyDetails details) {
176184 assertNotNull (details .getStateMatch ());
177185 assertNotNull (details .getTaxIdMatch ());
178186 }
179-
180- private void assertCompaniesAreValid (final List <Company > companies ) {
181- assertNotNull (companies );
182-
183- for (Company company : companies ) {
184- assertCompanyIsValid (company );
185- }
186- }
187187}
You can’t perform that action at this time.
0 commit comments