Skip to content

Commit

Permalink
Added test to make sure that the response id field is not null. (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
OGKevin committed Jan 3, 2018
1 parent cb62c17 commit 5b2a728
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/test/java/com/bunq/sdk/http/ErrorResponseTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.bunq.sdk.http;

import com.bunq.sdk.BunqSdkTestBase;
import com.bunq.sdk.exception.ApiException;
import com.bunq.sdk.model.generated.endpoint.UserPerson;
import org.junit.Test;

import static org.junit.Assert.assertNotNull;

public class ErrorResponseTest extends BunqSdkTestBase {
/**
* Invalid user id to trigger BadRequestException
*/
private static final int INVALID_USER_PERSON_ID = 0;

/**
*/
@Test
public void badRequestWitResponseIdTest()
{
ApiException caughtException = null;

try {
UserPerson.get(getApiContext(), INVALID_USER_PERSON_ID);
} catch (ApiException $exception) {
caughtException = $exception;
}

assertNotNull(caughtException);
assertNotNull(caughtException.getResponseId());
}
}

0 comments on commit 5b2a728

Please sign in to comment.