Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getCounterpartyAlias() returns null on payments #49

Closed
OGKevin opened this issue Dec 18, 2017 · 7 comments · Fixed by #68
Closed

getCounterpartyAlias() returns null on payments #49

OGKevin opened this issue Dec 18, 2017 · 7 comments · Fixed by #68
Assignees
Labels
Milestone

Comments

@OGKevin
Copy link
Contributor

OGKevin commented Dec 18, 2017

Steps to reproduce:

  1. Execute the following code:
        Payment.list(
            apiContext,
            userId,
            monetaryAccountId
        ).getValue().get(0).getCounterpartyAlias()

What should happen:

  1. MonetaryAccountReference reference is returned.

What happens:

  1. null is returned

Logs

  • Logs no logs

Extra info:

Reference

@OGKevin OGKevin added this to the 0.12.5 milestone Dec 18, 2017
@OGKevin OGKevin self-assigned this Dec 18, 2017
@OGKevin OGKevin added the bug label Dec 18, 2017
@OGKevin
Copy link
Contributor Author

OGKevin commented Dec 31, 2017

Cloud not reproduce this with the following test:

  @Test
  public void counterPartyAliasNotNullTest() {
    Pagination pagination = new Pagination();
    pagination.setCount(PAGE_SIZE);

    List<Payment> allPayment = Payment.list(
        apiContext,
        userId,
        monetaryAccountId,
        pagination.getUrlParamsCountOnly()
    ).getValue();

    for (Payment payment : allPayment) {
      Assert.assertNotNull(payment.getCounterpartyAlias());
      Assert.assertFalse(payment.getCounterpartyAlias().isAllFieldNull());
    }
  }

On 0.12.4

OGKevin added a commit that referenced this issue Dec 31, 2017
OGKevin added a commit that referenced this issue Dec 31, 2017
OGKevin added a commit that referenced this issue Jan 1, 2018
OGKevin added a commit that referenced this issue Jan 2, 2018
OGKevin added a commit that referenced this issue Jan 2, 2018
OGKevin added a commit that referenced this issue Jan 2, 2018
andrederoos added a commit that referenced this issue Jan 3, 2018
…l-payments

Get counterparty alias returns null on payments. (#49 )
@defl
Copy link

defl commented Jan 5, 2018

Hey @OGKevin, as you requested in the bunqtogether thread I've tested this with 0.12.4 but I still have the issue. However I see that there's more activity after this so I assume you guys still found it?

@OGKevin
Copy link
Contributor Author

OGKevin commented Jan 5, 2018

@defl Could you please provide a code snippet on how to reproduce this as I still cant reproduce this issue. #63 added a test to ensure that it is not null. Which passes without errors.

@defl
Copy link

defl commented Jan 7, 2018

It's a bit copy-paste, but basically:

ApiContext apiContext = ...;
MonetaryAccountBank bankAccount = ...;
List<Payment> payments = Payment.list(apiContext, bankAccount.getUserId(), bankAccount.getId()).getValue();

for(List<Payment> pp: payments) {
    for(Payment payment: pp) {
        System.out.println(payment.getCounterpartyAlias());
    }
}

@OGKevin
Copy link
Contributor Author

OGKevin commented Jan 7, 2018

@defl System.out.println(payment.getCounterpartyAlias()) prints null due to an error in its adapter. However the field its self is not null! Please try the following snippet and you will see:

      System.out.println(payment.getCounterpartyAlias().isAllFieldNull());

If it returns true then indeed all fields are null and then this is indeed a bug, if it returns false then everything is almost working as expected :P

Ill reopen the issue as the adapter is retuning null when the toString() and toJson() methods are called regardless the field having non null values.

@defl
Copy link

defl commented Jan 9, 2018

Thanks for fixing!

@OGKevin
Copy link
Contributor Author

OGKevin commented Jan 9, 2018

@defl no problem! Will be included in the 0.12.5 release 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants