Skip to content

Commit

Permalink
fix: updated class name
Browse files Browse the repository at this point in the history
  • Loading branch information
Neehaarika committed Jun 7, 2024
1 parent 83a2e06 commit d72b04d
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
package com.mx.path.model.mdx.accessor.account;

import com.mx.path.core.common.accessor.API;
import com.mx.path.core.common.accessor.AccessorMethodNotImplementedException;
import com.mx.path.core.common.gateway.GatewayAPI;
import com.mx.path.core.common.gateway.GatewayClass;
import com.mx.path.gateway.accessor.Accessor;
import com.mx.path.gateway.accessor.AccessorConfiguration;
import com.mx.path.gateway.accessor.AccessorResponse;
import com.mx.path.model.mdx.model.MdxList;
import com.mx.path.model.mdx.model.account.AccountAddress;

/**
* Accessor base for account addresses
*
* <p>See <a href="https://developer.mx.com/drafts/mdx/accounts/#addresses">specifications</a>
*/
@GatewayClass
@API(specificationUrl = "https://developer.mx.com/drafts/mdx/accounts/#addresses")
public class AccountAddressBaseAccessor extends Accessor {
public AccountAddressBaseAccessor() {
}

/**
* @param configuration
* @deprecated Use the default constructor, the configuration is set by the accessor construction context code
*/
@Deprecated
public AccountAddressBaseAccessor(AccessorConfiguration configuration) {
super(configuration);
}

/**
* Create an account address
*
* @param address
* @return
*/
@GatewayAPI
@API(description = "Create an account address")
public AccessorResponse<AccountAddress> create(AccountAddress address) {
throw new AccessorMethodNotImplementedException();
}

/**
* Delete address by id
*
* @param id
* @return
*/
@GatewayAPI
@API(description = "Delete an account address")
public AccessorResponse<Void> delete(String id) {
throw new AccessorMethodNotImplementedException();
}

/**
* Get address by id
*
* @param id
* @return
*/
@GatewayAPI
@API(description = "Get an account address")
public AccessorResponse<AccountAddress> get(String id) {
throw new AccessorMethodNotImplementedException();
}

/**
* List addresses
*
* @return
*/
@GatewayAPI
@API(description = "List all account addresses")
public AccessorResponse<MdxList<AccountAddress>> list() {
throw new AccessorMethodNotImplementedException();
}

/**
* Update address
*
* @param id
* @param address
* @return
*/
@GatewayAPI
@API(description = "Update an account address")
public AccessorResponse<AccountAddress> update(String id, AccountAddress address) {
throw new AccessorMethodNotImplementedException();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public abstract class AccountBaseAccessor extends Accessor {

@GatewayAPI
@Getter(AccessLevel.PROTECTED)
private AddressBaseAccessor addresses;
private AccountAddressBaseAccessor addresses;

@GatewayAPI
@Getter(AccessLevel.PROTECTED)
Expand Down Expand Up @@ -155,7 +155,7 @@ public AccountOverdraftBaseAccessor accountOverdrafts() {
* @return
*/
@API(description = "Access account overdrafts")
public AddressBaseAccessor addresses() {
public AccountAddressBaseAccessor addresses() {
if (addresses != null) {
return addresses;
}
Expand Down Expand Up @@ -250,7 +250,7 @@ public void setAccountStopPayments(AccountStopPaymentsBaseAccessor accountStopPa
*
* @param addresses
*/
public void setAddresses(AddressBaseAccessor addresses) {
public void setAddresses(AccountAddressBaseAccessor addresses) {
this.addresses = addresses;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import static org.mockito.Mockito.spy

import com.mx.path.gateway.accessor.AccessorResponse
import com.mx.path.gateway.api.Gateway
import com.mx.path.gateway.api.account.AccountAddressGateway
import com.mx.path.gateway.api.account.AccountGateway
import com.mx.path.gateway.api.account.AddressGateway
import com.mx.path.model.mdx.model.MdxList
import com.mx.path.model.mdx.model.account.AccountAddress
import com.mx.path.model.mdx.model.challenges.Challenge
Expand All @@ -20,11 +20,11 @@ import spock.lang.Specification
class AccountAddressControllerTest extends Specification implements WithMockery {
AccountAddressController subject
Gateway gateway
AddressGateway accountAddressGateway
AccountAddressGateway accountAddressGateway

def setup() {
subject = new AccountAddressController()
accountAddressGateway = spy(AddressGateway.builder().build())
accountAddressGateway = spy(AccountAddressGateway.builder().build())
gateway = Gateway.builder()
.accounts(AccountGateway.builder()
.addresses(accountAddressGateway)
Expand Down

0 comments on commit d72b04d

Please sign in to comment.