-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into remove_referral_by_from_nrtm_tests
- Loading branch information
Showing
3 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
import net.ripe.db.whois.api.rdap.domain.Notice; | ||
import net.ripe.db.whois.api.rdap.domain.RdapObject; | ||
import net.ripe.db.whois.api.rdap.domain.Redaction; | ||
import net.ripe.db.whois.api.rdap.domain.Role; | ||
import net.ripe.db.whois.api.rdap.domain.SearchResult; | ||
import net.ripe.db.whois.api.rest.client.RestClientUtils; | ||
import net.ripe.db.whois.common.rpsl.RpslObject; | ||
|
@@ -102,7 +103,6 @@ public void setup() throws IOException { | |
"upd-to: [email protected]\n" + | ||
"auth: MD5-PW $1$d9fKeTr2$Si7YudNf4rUGmR71n/cqk/ #test\n" + | ||
"mnt-by: OWNER-MNT\n" + | ||
"referral-by: OWNER-MNT\n" + | ||
"created: 2022-08-14T11:48:28Z\n" + | ||
"last-modified: 2022-10-25T12:22:39Z\n" + | ||
"source: TEST"); | ||
|
@@ -653,6 +653,51 @@ public void search_entity_multiple_object_response() { | |
assertThat(result.getNotices().get(0).getTitle(), is("Terms and Conditions")); | ||
} | ||
|
||
@Test | ||
public void search_entity_handle_mntner_then_response() { | ||
|
||
final SearchResult result = createResource("entities?handle=OWNER-MNT") | ||
.request(MediaType.APPLICATION_JSON_TYPE) | ||
.get(SearchResult.class); | ||
|
||
assertThat( | ||
result.getEntitySearchResults() | ||
.stream() | ||
.map(Entity::getHandle) | ||
.collect(Collectors.toList()), | ||
containsInAnyOrder("OWNER-MNT")); | ||
|
||
assertThat(result.getNotices(), hasSize(1)); | ||
assertThat(result.getNotices().getFirst().getTitle(), is("Terms and Conditions")); | ||
|
||
assertThat(result.getEntitySearchResults(), hasSize(1)); | ||
|
||
final Entity firstEntity = result.getEntitySearchResults().getFirst(); | ||
assertThat(firstEntity.getHandle(), is("OWNER-MNT")); | ||
assertThat(firstEntity.getVCardArray().toString(), is("[vcard, [" + | ||
"[version, {}, text, 4.0], [fn, {}, text, OWNER-MNT], [kind, {}, text, individual]]]")); | ||
|
||
assertThat(result.getEntitySearchResults().getFirst().getEntitySearchResults(), hasSize(2)); | ||
|
||
//mnt-by OWNER-MNT | ||
final Entity firstEntityMntBy = result.getEntitySearchResults().getFirst().getEntitySearchResults().getFirst(); | ||
assertThat(firstEntityMntBy.getHandle(), is("OWNER-MNT")); | ||
assertThat(firstEntityMntBy.getVCardArray().toString(), is("[vcard, [" + | ||
"[version, {}, text, 4.0], [fn, {}, text, OWNER-MNT], [kind, {}, text, individual]]]")); | ||
assertThat(firstEntityMntBy.getRoles(), hasSize(1)); | ||
assertThat(firstEntityMntBy.getRoles().getFirst(), is(Role.REGISTRANT)); | ||
|
||
|
||
//admin-c TP1-TEST | ||
final Entity secondEntityAdminC = result.getEntitySearchResults().getFirst().getEntitySearchResults().get(1); | ||
assertThat(secondEntityAdminC.getHandle(), is("TP1-TEST")); | ||
assertThat(secondEntityAdminC.getVCardArray().toString(), is("[vcard, [" + | ||
"[version, {}, text, 4.0], [fn, {}, text, Test Person], [kind, {}, text, individual], " + | ||
"[adr, {label=Singel 258}, text, [, , , , , , ]], [tel, {type=voice}, text, +31 6 12345678]]]")); | ||
assertThat(secondEntityAdminC.getRoles(), hasSize(1)); | ||
assertThat(secondEntityAdminC.getRoles().getFirst(), is(Role.ADMINISTRATIVE)); | ||
} | ||
|
||
@Test | ||
public void lookup_person_entity_acl_denied() { | ||
try { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,6 @@ public void setup() { | |
"upd-to: [email protected]\n" + | ||
"auth: MD5-PW $1$d9fKeTr2$Si7YudNf4rUGmR71n/cqk/ #test\n" + | ||
"mnt-by: OWNER-MNT\n" + | ||
"referral-by: OWNER-MNT\n" + | ||
"created: 2022-08-14T11:48:28Z\n" + | ||
"last-modified: 2022-10-25T12:22:39Z\n" + | ||
"source: TEST"); | ||
|