mirror of https://github.com/apache/cloudstack.git
override findById for dnsServer
This commit is contained in:
parent
1da794f4d9
commit
8d365cbd71
|
|
@ -76,7 +76,6 @@ public class UpdateDnsServerCmd extends BaseCmd {
|
|||
private String publicDomainSuffix;
|
||||
|
||||
@Parameter(name = ApiConstants.NAME_SERVERS, type = CommandType.LIST, collectionType = CommandType.STRING,
|
||||
required = true,
|
||||
description = "Comma separated list of name servers; used to create NS records for the DNS Zone (for example, ns1.example.com, ns2.example.com)")
|
||||
private List<String> nameServers;
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ import com.cloud.utils.db.Filter;
|
|||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
public interface DnsServerDao extends GenericDao<DnsServerVO, Long> {
|
||||
|
||||
DnsServerVO findById(Long dnsServerId);
|
||||
|
||||
DnsServer findByUrlAndAccount(String url, long accountId);
|
||||
|
||||
List<Long> listDnsServerIdsByAccountId(Long accountId);
|
||||
|
|
|
|||
|
|
@ -74,6 +74,13 @@ public class DnsServerDaoImpl extends GenericDaoBase<DnsServerVO, Long> implemen
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public DnsServerVO findById(Long dnsServerId) {
|
||||
DnsServerVO dnsServer = super.findById(dnsServerId);
|
||||
loadDetails(dnsServer);
|
||||
return dnsServer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DnsServer findByUrlAndAccount(String url, long accountId) {
|
||||
SearchCriteria<DnsServerVO> sc = AccountUrlSearch.create();
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@ import static org.mockito.Mockito.when;
|
|||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.cloudstack.api.command.user.dns.CreateDnsZoneCmd;
|
||||
import org.apache.cloudstack.api.command.user.dns.DeleteDnsServerCmd;
|
||||
|
|
@ -158,6 +160,10 @@ public class DnsProviderManagerImplTest {
|
|||
serverVO = Mockito.spy(
|
||||
new DnsServerVO("test-server", "http://pdns:8081", 8081, DnsProviderType.PowerDNS, null,
|
||||
"apikey", false, null, Collections.singletonList("ns1.example.com"), ACCOUNT_ID, DOMAIN_ID));
|
||||
|
||||
Map<String, String> serverDetails = new HashMap<>();
|
||||
serverDetails.put("pdsnServerId", "localhost");
|
||||
serverVO.setDetails(serverDetails);
|
||||
Mockito.lenient().doReturn(SERVER_ID).when(serverVO).getId();
|
||||
|
||||
zoneVO = Mockito.spy(
|
||||
|
|
|
|||
Loading…
Reference in New Issue