Skip to content

Commit 297078b

Browse files
committed
Remove dead test code
- These tests will never actually be useful. They were written assuming (more reasonable) soft deletion behavior that does not exist now nor will it ever exist since we must preserve backwards compatibility. - Remove no longer applicable comment. - Small test reformatting.
1 parent 4b603c6 commit 297078b

File tree

1 file changed

+3
-112
lines changed

1 file changed

+3
-112
lines changed

src/test/java/com/blockscore/models/CandidateTest.java

Lines changed: 3 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ public void testCandidateCreation() {
3434

3535
@Test
3636
public void testCandidateCreation_EmptyCandidate() {
37-
Candidate candidate = createEmptyCandidate();
38-
assertCandidateIsValid(candidate);
37+
assertCandidateIsValid(createEmptyCandidate());
3938
}
4039

4140
@Test
@@ -91,21 +90,13 @@ public void testCandidateUpdate() {
9190

9291
@Test
9392
public void testWatchlistSearch() {
94-
Candidate candidate = createTestCandidate();
95-
96-
PaginatedResult<WatchlistHit> results = candidate.searchWatchlists();
97-
// TODO: Update validation logic when sample data is available.
98-
// Tests for different match_type & similarity_threshold
99-
// requests would also be worthwhile.
100-
// See note below.
101-
assertHitsAreValid(results.getData());
93+
assertHitsAreValid(createTestCandidate().searchWatchlists().getData());
10294
}
10395

10496

10597
@Test
10698
public void testCandidateListing() {
107-
PaginatedResult<Candidate> candidateList = client.listCandidates();
108-
assertCandidatesAreValid(candidateList.getData());
99+
assertCandidatesAreValid(client.listCandidates().getData());
109100
}
110101

111102
@Test
@@ -123,113 +114,13 @@ public void testCandidateHistory() {
123114
assertEquals("Mouse", history.get(0).getLastName());
124115
}
125116

126-
// NOTE: All commented code that follows requires deletion to be functional server-side.
127-
// Currently deleting a candidate shows "deleted":true in the
128-
// server response but you can still successfully retrieve/update/delete
129-
// the deleted candidate which should not happen.
130-
131117
@Test
132118
public void testCandidateDeletion() {
133-
//InvalidRequestException expected = null;
134-
135119
Candidate candidate = createTestCandidate();
136120

137121
candidate.delete();
138-
139-
// try {
140-
// client.retrieveCandidate(candidate.getId());
141-
// } catch (InvalidRequestException e) {
142-
// assertNotNull(e.getMessage());
143-
// expected = e;
144-
// }
145-
//
146-
// assertNotNull(expected);
147122
}
148123

149-
// @Test
150-
// public void testWatchlistSearch_DeletedCandidate() {
151-
// InvalidRequestException expected = null;
152-
//
153-
// Candidate candidate = createTestCandidate();
154-
// candidate.delete();
155-
//
156-
// try {
157-
// candidate.searchWatchlists();
158-
// } catch (InvalidRequestException e) {
159-
// assertNotNull(e.getMessage());
160-
// expected = e;
161-
// }
162-
//
163-
// assertNotNull(expected);
164-
// }
165-
166-
// @Test
167-
// public void testCandidateUpdate_DeletedCandidate() {
168-
// InvalidRequestException expected = null;
169-
//
170-
// Candidate candidate = createTestCandidate();
171-
// candidate.delete();
172-
//
173-
// try {
174-
// candidate.save();
175-
// } catch (InvalidRequestException e) {
176-
// assertNotNull(e.getMessage());
177-
// expected = e;
178-
// }
179-
//
180-
// assertNotNull(expected);
181-
// }
182-
183-
// @Test
184-
// public void testRevisionHistory_DeletedCandidate() {
185-
// InvalidRequestException expected = null;
186-
//
187-
// Candidate candidate = createTestCandidate();
188-
// candidate.delete();
189-
//
190-
// try {
191-
// candidate.getRevisionHistory();
192-
// } catch (InvalidRequestException e) {
193-
// assertNotNull(e.getMessage());
194-
// expected = e;
195-
// }
196-
//
197-
// assertNotNull(expected);
198-
// }
199-
200-
// @Test
201-
// public void testPastHits_DeletedCandidate() {
202-
// InvalidRequestException expected = null;
203-
//
204-
// Candidate candidate = createTestCandidate();
205-
// candidate.delete();
206-
//
207-
// try {
208-
// candidate.getPastHits();
209-
// } catch (InvalidRequestException e) {
210-
// assertNotNull(e.getMessage());
211-
// expected = e;
212-
// }
213-
// assertNotNull(expected);
214-
// }
215-
216-
// @Test
217-
// public void testCandidateDeletion_DeletedCandidate() {
218-
// InvalidRequestException expected = null;
219-
//
220-
// Candidate candidate = createTestCandidate();
221-
// candidate.delete();
222-
//
223-
// try {
224-
// candidate.delete();
225-
// } catch (InvalidRequestException e) {
226-
// assertNotNull(e.getMessage());
227-
// expected = e;
228-
// }
229-
//
230-
// assertNotNull(expected);
231-
// }
232-
233124
/*------------------*/
234125
/* Helper Functions */
235126
/*------------------*/

0 commit comments

Comments
 (0)