Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## main

- REMOVED: Removed deprecated `getWhoisPrivacy` (dnsimple/dnsimple-developer#919)
- REMOVED: Removed deprecated `renewWhoisPrivacy` (dnsimple/dnsimple-developer#919)

## 4.0.1

- HOUSEKEEPING: Update release process
Expand Down
58 changes: 0 additions & 58 deletions src/main/java/com/dnsimple/data/WhoisPrivacyRenewal.java

This file was deleted.

24 changes: 0 additions & 24 deletions src/main/java/com/dnsimple/endpoints/Registrar.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,6 @@ public EmptyResponse disableAutoRenewal(Number account, String domain) {
return client.empty(DELETE, account + "/registrar/domains/" + domain + "/auto_renewal", ListOptions.empty(), null);
}

/**
* Gets the whois privacy for the domain.
*
* @param account The account ID
* @param domain The domain name or ID
* @return The get whois privacy response
* @see <a href="https://developer.dnsimple.com/v2/registrar/whois-privacy/#getWhoisPrivacy">https://developer.dnsimple.com/v2/registrar/whois-privacy/#getWhoisPrivacy</a>
*/
public SimpleResponse<WhoisPrivacy> getWhoisPrivacy(Number account, String domain) {
return client.simple(GET, account + "/registrar/domains/" + domain + "/whois_privacy", ListOptions.empty(), null, WhoisPrivacy.class);
}

/**
* Enable whois privacy for the domain.
*
Expand All @@ -231,18 +219,6 @@ public SimpleResponse<WhoisPrivacy> disableWhoisPrivacy(Number account, String d
return client.simple(DELETE, account + "/registrar/domains/" + domain + "/whois_privacy", ListOptions.empty(), null, WhoisPrivacy.class);
}

/**
* Renew whois privacy for the domain.
*
* @param account The account ID
* @param domain The domain name or ID
* @return The disable whois privacy response
* @see <a href="https://developer.dnsimple.com/v2/registrar/whois-privacy/#renewWhoisPrivacy">https://developer.dnsimple.com/v2/registrar/whois-privacy/#renewWhoisPrivacy</a>
*/
public SimpleResponse<WhoisPrivacyRenewal> renewWhoisPrivacy(Number account, String domain) {
return client.simple(POST, account + "/registrar/domains/" + domain + "/whois_privacy/renewals", ListOptions.empty(), null, WhoisPrivacyRenewal.class);
}

/**
* Lists name servers the domain is delegating to.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
package com.dnsimple.endpoints;

import com.dnsimple.data.WhoisPrivacy;
import com.dnsimple.data.WhoisPrivacyRenewal;
import com.dnsimple.tools.DnsimpleTestBase;
import org.junit.Test;

import java.time.LocalDate;
import java.time.OffsetDateTime;

import static com.dnsimple.http.HttpMethod.*;
import static java.time.ZoneOffset.UTC;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

public class RegistrarWhoisPrivacyTest extends DnsimpleTestBase {
@Test
public void testGetWhoisPrivacy() {
server.stubFixtureAt("getWhoisPrivacy/success.http");
WhoisPrivacy whoisPrivacy = client.registrar.getWhoisPrivacy(1010, "example.com").getData();
assertThat(server.getRecordedRequest().getMethod(), is(GET));
assertThat(server.getRecordedRequest().getPath(), is("/v2/1010/registrar/domains/example.com/whois_privacy"));
assertThat(whoisPrivacy.getId(), is(1L));
assertThat(whoisPrivacy.getDomainId(), is(2L));
assertThat(whoisPrivacy.getExpiresOn(), is(LocalDate.of(2017, 2, 13)));
assertThat(whoisPrivacy.isEnabled(), is(true));
assertThat(whoisPrivacy.getCreatedAt(), is(OffsetDateTime.of(2016, 2, 13, 14, 34, 50, 0, UTC)));
assertThat(whoisPrivacy.getUpdatedAt(), is(OffsetDateTime.of(2016, 2, 13, 14, 34, 52, 0, UTC)));
}

@Test
public void testEnableWhoisPrivacyAlreadyPurchased() {
server.stubFixtureAt("enableWhoisPrivacy/success.http");
Expand All @@ -53,20 +34,4 @@ public void testDisableWhoisPrivacyNewlyPurchased() {
assertThat(server.getRecordedRequest().getPath(), is("/v2/1010/registrar/domains/example.com/whois_privacy"));
assertThat(whoisPrivacy.getId(), is(1L));
}

@Test
public void testRenewWhoisPrivacy() {
server.stubFixtureAt("renewWhoisPrivacy/success.http");
WhoisPrivacyRenewal whoisPrivacyRenewal = client.registrar.renewWhoisPrivacy(1010, "example.com").getData();
assertThat(server.getRecordedRequest().getMethod(), is(POST));
assertThat(server.getRecordedRequest().getPath(), is("/v2/1010/registrar/domains/example.com/whois_privacy/renewals"));
assertThat(whoisPrivacyRenewal.getId(), is(1L));
assertThat(whoisPrivacyRenewal.getDomainId(), is(100L));
assertThat(whoisPrivacyRenewal.getWhoisPrivacyId(), is(999L));
assertThat(whoisPrivacyRenewal.getState(), is("new"));
assertThat(whoisPrivacyRenewal.isEnabled(), is(true));
assertThat(whoisPrivacyRenewal.getExpiresOn(), is(LocalDate.of(2020, 1, 10)));
assertThat(whoisPrivacyRenewal.getCreatedAt(), is(OffsetDateTime.of(2019, 1, 10, 12, 12, 48, 0, UTC)));
assertThat(whoisPrivacyRenewal.getUpdatedAt(), is(OffsetDateTime.of(2019, 1, 10, 12, 12, 48, 0, UTC)));
}
}
16 changes: 0 additions & 16 deletions src/test/resources/com/dnsimple/getWhoisPrivacy/success.http

This file was deleted.

20 changes: 0 additions & 20 deletions src/test/resources/com/dnsimple/renewWhoisPrivacy/success.http

This file was deleted.

This file was deleted.

This file was deleted.