Skip to content

Commit

Permalink
feedback formatting, test, avoid inline if (bunq#93)
Browse files Browse the repository at this point in the history
at the cost of risk for index-out-of-bounds (prior code)
  • Loading branch information
tubbynl committed Jun 19, 2018
1 parent d77e23d commit 0bc1987
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public User getFirstUser() {
BunqResponseRaw responseRaw = getRawResponse(USER_URL);
BunqResponse<List<User>> response = fromJsonList(User.class, responseRaw);

return !response.getValue().isEmpty()?response.getValue().get(FIRST):null;
return response.getValue().get(FIRST);
}

public MonetaryAccountBank getFirstActiveMonetaryAccountBankByUserId(Integer userId) {
Expand Down
9 changes: 5 additions & 4 deletions src/test/java/com/bunq/sdk/context/UserContextTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
public class UserContextTest extends BunqSdkTestBase {

@Test
public void testConstruct() {
public void buildUserContext() {
ApiContext context = getApiContext();

UserContext sut = new UserContext(context);
UserContext userContext = new UserContext(context);

assertNotNull(sut.getUserId());
assertNotNull(sut.getMainMonetaryAccountId());
assertNotNull(userContext.getUserId());
assertNotNull(userContext.getMainMonetaryAccountId());
}
}

0 comments on commit 0bc1987

Please sign in to comment.