Skip to content

Commit 9b2ccfb

Browse files
authored
Removed deprecated getWhoisPrivacy and renewWhoisPrivacy (#231)
See dnsimple/dnsimple-developer#919
1 parent fb23b5a commit 9b2ccfb

File tree

8 files changed

+3
-189
lines changed

8 files changed

+3
-189
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## main
44

5+
- REMOVED: Removed deprecated `getWhoisPrivacy` (dnsimple/dnsimple-developer#919)
6+
- REMOVED: Removed deprecated `renewWhoisPrivacy` (dnsimple/dnsimple-developer#919)
7+
58
## 4.0.1
69

710
- HOUSEKEEPING: Update release process

src/main/java/com/dnsimple/data/WhoisPrivacyRenewal.java

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/main/java/com/dnsimple/endpoints/Registrar.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -195,18 +195,6 @@ public EmptyResponse disableAutoRenewal(Number account, String domain) {
195195
return client.empty(DELETE, account + "/registrar/domains/" + domain + "/auto_renewal", ListOptions.empty(), null);
196196
}
197197

198-
/**
199-
* Gets the whois privacy for the domain.
200-
*
201-
* @param account The account ID
202-
* @param domain The domain name or ID
203-
* @return The get whois privacy response
204-
* @see <a href="https://developer.dnsimple.com/v2/registrar/whois-privacy/#getWhoisPrivacy">https://developer.dnsimple.com/v2/registrar/whois-privacy/#getWhoisPrivacy</a>
205-
*/
206-
public SimpleResponse<WhoisPrivacy> getWhoisPrivacy(Number account, String domain) {
207-
return client.simple(GET, account + "/registrar/domains/" + domain + "/whois_privacy", ListOptions.empty(), null, WhoisPrivacy.class);
208-
}
209-
210198
/**
211199
* Enable whois privacy for the domain.
212200
*
@@ -231,18 +219,6 @@ public SimpleResponse<WhoisPrivacy> disableWhoisPrivacy(Number account, String d
231219
return client.simple(DELETE, account + "/registrar/domains/" + domain + "/whois_privacy", ListOptions.empty(), null, WhoisPrivacy.class);
232220
}
233221

234-
/**
235-
* Renew whois privacy for the domain.
236-
*
237-
* @param account The account ID
238-
* @param domain The domain name or ID
239-
* @return The disable whois privacy response
240-
* @see <a href="https://developer.dnsimple.com/v2/registrar/whois-privacy/#renewWhoisPrivacy">https://developer.dnsimple.com/v2/registrar/whois-privacy/#renewWhoisPrivacy</a>
241-
*/
242-
public SimpleResponse<WhoisPrivacyRenewal> renewWhoisPrivacy(Number account, String domain) {
243-
return client.simple(POST, account + "/registrar/domains/" + domain + "/whois_privacy/renewals", ListOptions.empty(), null, WhoisPrivacyRenewal.class);
244-
}
245-
246222
/**
247223
* Lists name servers the domain is delegating to.
248224
*
Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,14 @@
11
package com.dnsimple.endpoints;
22

33
import com.dnsimple.data.WhoisPrivacy;
4-
import com.dnsimple.data.WhoisPrivacyRenewal;
54
import com.dnsimple.tools.DnsimpleTestBase;
65
import org.junit.Test;
76

8-
import java.time.LocalDate;
9-
import java.time.OffsetDateTime;
10-
117
import static com.dnsimple.http.HttpMethod.*;
12-
import static java.time.ZoneOffset.UTC;
138
import static org.hamcrest.MatcherAssert.assertThat;
149
import static org.hamcrest.Matchers.is;
1510

1611
public class RegistrarWhoisPrivacyTest extends DnsimpleTestBase {
17-
@Test
18-
public void testGetWhoisPrivacy() {
19-
server.stubFixtureAt("getWhoisPrivacy/success.http");
20-
WhoisPrivacy whoisPrivacy = client.registrar.getWhoisPrivacy(1010, "example.com").getData();
21-
assertThat(server.getRecordedRequest().getMethod(), is(GET));
22-
assertThat(server.getRecordedRequest().getPath(), is("/v2/1010/registrar/domains/example.com/whois_privacy"));
23-
assertThat(whoisPrivacy.getId(), is(1L));
24-
assertThat(whoisPrivacy.getDomainId(), is(2L));
25-
assertThat(whoisPrivacy.getExpiresOn(), is(LocalDate.of(2017, 2, 13)));
26-
assertThat(whoisPrivacy.isEnabled(), is(true));
27-
assertThat(whoisPrivacy.getCreatedAt(), is(OffsetDateTime.of(2016, 2, 13, 14, 34, 50, 0, UTC)));
28-
assertThat(whoisPrivacy.getUpdatedAt(), is(OffsetDateTime.of(2016, 2, 13, 14, 34, 52, 0, UTC)));
29-
}
30-
3112
@Test
3213
public void testEnableWhoisPrivacyAlreadyPurchased() {
3314
server.stubFixtureAt("enableWhoisPrivacy/success.http");
@@ -53,20 +34,4 @@ public void testDisableWhoisPrivacyNewlyPurchased() {
5334
assertThat(server.getRecordedRequest().getPath(), is("/v2/1010/registrar/domains/example.com/whois_privacy"));
5435
assertThat(whoisPrivacy.getId(), is(1L));
5536
}
56-
57-
@Test
58-
public void testRenewWhoisPrivacy() {
59-
server.stubFixtureAt("renewWhoisPrivacy/success.http");
60-
WhoisPrivacyRenewal whoisPrivacyRenewal = client.registrar.renewWhoisPrivacy(1010, "example.com").getData();
61-
assertThat(server.getRecordedRequest().getMethod(), is(POST));
62-
assertThat(server.getRecordedRequest().getPath(), is("/v2/1010/registrar/domains/example.com/whois_privacy/renewals"));
63-
assertThat(whoisPrivacyRenewal.getId(), is(1L));
64-
assertThat(whoisPrivacyRenewal.getDomainId(), is(100L));
65-
assertThat(whoisPrivacyRenewal.getWhoisPrivacyId(), is(999L));
66-
assertThat(whoisPrivacyRenewal.getState(), is("new"));
67-
assertThat(whoisPrivacyRenewal.isEnabled(), is(true));
68-
assertThat(whoisPrivacyRenewal.getExpiresOn(), is(LocalDate.of(2020, 1, 10)));
69-
assertThat(whoisPrivacyRenewal.getCreatedAt(), is(OffsetDateTime.of(2019, 1, 10, 12, 12, 48, 0, UTC)));
70-
assertThat(whoisPrivacyRenewal.getUpdatedAt(), is(OffsetDateTime.of(2019, 1, 10, 12, 12, 48, 0, UTC)));
71-
}
7237
}

src/test/resources/com/dnsimple/getWhoisPrivacy/success.http

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/test/resources/com/dnsimple/renewWhoisPrivacy/success.http

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/test/resources/com/dnsimple/renewWhoisPrivacy/whois-privacy-duplicated-order.http

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/test/resources/com/dnsimple/renewWhoisPrivacy/whois-privacy-not-found.http

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)