diff --git a/README.md b/README.md index e0b4f65..9cc76eb 100644 --- a/README.md +++ b/README.md @@ -9,15 +9,18 @@ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0) ### Releases + [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.proshin/finapi-java-client/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.proshin/finapi-java-client) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fproshin-roman%2Ffinapi-java-client.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fproshin-roman%2Ffinapi-java-client?ref=badge_shield) [![](https://jitpack.io/v/proshin-roman/finapi-java-client.svg)](https://jitpack.io/#proshin-roman/finapi-java-client) ### Builds + [![Build Status](https://travis-ci.com/proshin-roman/finapi-java-client.svg?branch=master)](https://travis-ci.com/proshin-roman/finapi-java-client) [![Build status](https://ci.appveyor.com/api/projects/status/n88wydxq8oa0eou0/branch/master?svg=true)](https://ci.appveyor.com/project/proshin-roman/finapi-java-client/branch/master) ### Code quality + [![codecov](https://codecov.io/gh/proshin-roman/finapi-java-client/branch/master/graph/badge.svg)](https://codecov.io/gh/proshin-roman/finapi-java-client) [![Coverage Status](https://coveralls.io/repos/github/proshin-roman/finapi-java-client/badge.svg?branch=coverall-integration)](https://coveralls.io/github/proshin-roman/finapi-java-client?branch=master) [![codebeat badge](https://codebeat.co/badges/907cb4b8-0f65-446a-a874-9ece228ab579)](https://codebeat.co/projects/github-com-proshin-roman-finapi-java-client-master) @@ -25,13 +28,13 @@ [![CodeFactor](https://www.codefactor.io/repository/github/proshin-roman/finapi-java-client/badge)](https://www.codefactor.io/repository/github/proshin-roman/finapi-java-client) [![Hits-of-Code](https://hitsofcode.com/github/proshin-roman/finapi-java-client)](https://hitsofcode.com/view/github/proshin-roman/finapi-java-client) - ### Puzzle Driven Development + [![PDD status](http://www.0pdd.com/svg?name=proshin-roman/finapi-java-client)](http://www.0pdd.com/p?name=proshin-roman/finapi-java-client) ### Community -[![Join the chat at https://gitter.im/finapi-java-client/Lobby](https://badges.gitter.im/finapi-java-client/Lobby.svg)](https://gitter.im/finapi-java-client/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Join the chat at https://gitter.im/finapi-java-client/Lobby](https://badges.gitter.im/finapi-java-client/Lobby.svg)](https://gitter.im/finapi-java-client/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) **finapi-java-client** is a true-OOP Java client for API provided by [finAPI](https://finapi.io). @@ -39,22 +42,26 @@ The project is following the next principles (it is a subset of [those ones](https://www.elegantobjects.org/#principles)): - No null + ![nullfree status](https://iwillfailyou.com/nullfree/proshin-roman/finapi-java-client) - No getters and setters + ![setterfree status](https://iwillfailyou.com/setterfree/proshin-roman/finapi-java-client) - No mutable objects + ![allfinal status](https://iwillfailyou.com/allfinal/proshin-roman/finapi-java-client) - No static methods, not even private ones + ![staticfree status](https://iwillfailyou.com/staticfree/proshin-roman/finapi-java-client) + ![allpublic status](https://iwillfailyou.com/allpublic/proshin-roman/finapi-java-client) - No instanceof, type casting or reflection - No implementation inheritance + ![inheritancefree status](https://iwillfailyou.com/inheritancefree/proshin-roman/finapi-java-client) +- No multiple returns + ![nomultiplereturn status](https://iwillfailyou.com/nomultiplereturn/proshin-roman/finapi-java-client) All badges are through [iwillfailyou](https://iwillfailyou.com/) - -![nullfree status](https://iwillfailyou.com/nullfree/proshin-roman/finapi-java-client) -![staticfree status](https://iwillfailyou.com/staticfree/proshin-roman/finapi-java-client) -![allfinal status](https://iwillfailyou.com/allfinal/proshin-roman/finapi-java-client) -![allpublic status](https://iwillfailyou.com/allpublic/proshin-roman/finapi-java-client) ## How to use Just add the following lines into your `pom.xml` + ```!xml org.proshin @@ -62,6 +69,7 @@ Just add the following lines into your `pom.xml` ${version} ``` + You can find the latest `version` on [`Releases`](https://github.com/proshin-roman/finapi-java-client/releases) page. ## What about logging? @@ -98,6 +106,7 @@ Versioning is done using [jgitver](https://github.com/jgitver/jgitver) tool, so the version. ## License + Copyright 2018-2019 Roman Proshin Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/pom.xml b/pom.xml index e4d7c31..7df90c3 100644 --- a/pom.xml +++ b/pom.xml @@ -280,7 +280,7 @@ com.iwillfailyou iwillfailyou-maven-plugin - 0.2.0 + 0.5.0 @@ -304,7 +304,24 @@ false 0 + + glob:**/test/**/*Test.java + + false + 0 + + + false + 0 + + + false + 0 + + + glob:**/test/**/*Test.java,glob:**/main/**/*Exception.java + diff --git a/src/main/java/org/proshin/finapi/bankconnection/out/FpTwoStepProcedures.java b/src/main/java/org/proshin/finapi/bankconnection/out/FpTwoStepProcedures.java index ab13ae1..d6a14ed 100644 --- a/src/main/java/org/proshin/finapi/bankconnection/out/FpTwoStepProcedures.java +++ b/src/main/java/org/proshin/finapi/bankconnection/out/FpTwoStepProcedures.java @@ -30,6 +30,7 @@ public FpTwoStepProcedures(final JSONObject origin) { } @Override + @SuppressWarnings("nomultiplereturn") // will be fixed in https://github.com/iwillfailyou/java-inspections/pull/24 public Optional defaultOne() { return new OptionalOf<>( this.origin, diff --git a/src/main/java/org/proshin/finapi/endpoint/FpEndpoint.java b/src/main/java/org/proshin/finapi/endpoint/FpEndpoint.java index bfbe7c1..1088e97 100644 --- a/src/main/java/org/proshin/finapi/endpoint/FpEndpoint.java +++ b/src/main/java/org/proshin/finapi/endpoint/FpEndpoint.java @@ -168,10 +168,12 @@ public String patch(final String path, final AccessToken token, final Jsonable b ); } + @SuppressWarnings("allpublic") private String execute(final HttpUriRequest request) { return this.execute(request, HttpStatus.SC_OK); } + @SuppressWarnings("allpublic") private String execute(final HttpUriRequest request, final int expected) { try { final HttpResponse response = this.client.execute(request); diff --git a/src/main/java/org/proshin/finapi/mandator/FpMandator.java b/src/main/java/org/proshin/finapi/mandator/FpMandator.java index 42f6980..8157c38 100644 --- a/src/main/java/org/proshin/finapi/mandator/FpMandator.java +++ b/src/main/java/org/proshin/finapi/mandator/FpMandator.java @@ -58,6 +58,7 @@ public Page users(final UsersCriteria criteria) { } @Override + @SuppressWarnings("nomultiplereturn") // will be fixed in https://github.com/iwillfailyou/java-inspections/pull/24 public DeletionResult deleteUsers(final Iterable ids) { return new FpDeletionResult( new JSONObject( diff --git a/src/test/java/org/proshin/finapi/TestWithMockedEndpoint.java b/src/test/java/org/proshin/finapi/TestWithMockedEndpoint.java index 31f65d6..2373dcd 100644 --- a/src/test/java/org/proshin/finapi/TestWithMockedEndpoint.java +++ b/src/test/java/org/proshin/finapi/TestWithMockedEndpoint.java @@ -24,7 +24,7 @@ import org.proshin.finapi.endpoint.FpEndpoint; @ExtendWith(MockServerExtension.class) -@SuppressWarnings({"AbstractClassWithoutAbstractMethods", "allfinal"}) +@SuppressWarnings({"AbstractClassWithoutAbstractMethods", "allfinal", "allpublic"}) public abstract class TestWithMockedEndpoint { @SuppressWarnings({"InstanceVariableMayNotBeInitialized", "allfinal"}) @@ -33,7 +33,7 @@ public abstract class TestWithMockedEndpoint { private Endpoint endpoint; @BeforeEach - public void init(@Nonnull final MockServerClient server) { + void init(@Nonnull final MockServerClient server) { this.server = server; this.endpoint = new FpEndpoint("http://localhost:" + this.server.remoteAddress().getPort()); } diff --git a/src/test/java/org/proshin/finapi/accesstoken/FpAccessTokensTest.java b/src/test/java/org/proshin/finapi/accesstoken/FpAccessTokensTest.java index 23cc8a2..09ea8b1 100644 --- a/src/test/java/org/proshin/finapi/accesstoken/FpAccessTokensTest.java +++ b/src/test/java/org/proshin/finapi/accesstoken/FpAccessTokensTest.java @@ -26,10 +26,10 @@ import org.proshin.finapi.TestWithMockedEndpoint; import org.proshin.finapi.fake.FakeAccessToken; -public final class FpAccessTokensTest extends TestWithMockedEndpoint { +final class FpAccessTokensTest extends TestWithMockedEndpoint { @Test - public void testThatClientTokenReturnsValidToken() { + void testThatClientTokenReturnsValidToken() { final String clientId = "client ID #1"; final String clientSecret = "client secret #1"; this.server() @@ -57,13 +57,13 @@ public void testThatClientTokenReturnsValidToken() { final AccessToken token = new FpAccessTokens(this.endpoint()).clientToken(clientId, clientSecret); assertThat(token.accessToken()).isEqualTo("access token"); assertThat(token.tokenType()).isEqualTo("bearer"); - assertThat(token.refreshToken().isPresent()).isFalse(); + assertThat(token.refreshToken()).isNotPresent(); assertThat(token.expiresIn()).isEqualTo(156); assertThat(token.scope()).isEqualTo("all"); } @Test - public void testThatUserTokenReturnsValidToken() { + void testThatUserTokenReturnsValidToken() { final String clientId = "client ID #2"; final String clientSecret = "client secret #2"; final String username = "username #2"; @@ -103,7 +103,7 @@ public void testThatUserTokenReturnsValidToken() { } @Test - public void testGettingUserTokenUsingRefreshToken() { + void testGettingUserTokenUsingRefreshToken() { final String clientId = "client ID #2"; final String clientSecret = "client secret #2"; final String refreshToken = "refresh token"; @@ -141,7 +141,7 @@ public void testGettingUserTokenUsingRefreshToken() { } @Test - public void testRevokeTokenAccessTokenOnly() { + void testRevokeTokenAccessTokenOnly() { final String clientId = "client ID #2"; final String clientSecret = "client secret #2"; final String refreshToken = "refresh token"; @@ -167,7 +167,7 @@ public void testRevokeTokenAccessTokenOnly() { } @Test - public void testRevokeTokenRefreshTokenOnly() { + void testRevokeTokenRefreshTokenOnly() { final String clientId = "client ID #2"; final String clientSecret = "client secret #2"; final String refreshToken = "refresh token"; diff --git a/src/test/java/org/proshin/finapi/accesstoken/UserAccessTokenTest.java b/src/test/java/org/proshin/finapi/accesstoken/UserAccessTokenTest.java index 031284d..b96b080 100644 --- a/src/test/java/org/proshin/finapi/accesstoken/UserAccessTokenTest.java +++ b/src/test/java/org/proshin/finapi/accesstoken/UserAccessTokenTest.java @@ -5,10 +5,10 @@ import org.junit.jupiter.api.Test; import org.proshin.finapi.exception.NoFieldException; -public final class UserAccessTokenTest { +final class UserAccessTokenTest { @Test - public void testThatUserTokenFailsIfNoRefreshTokenIsSent() { + void testThatUserTokenFailsIfNoRefreshTokenIsSent() { final AccessToken token = new UserAccessToken(new JSONObject( String.join("", "{", diff --git a/src/test/java/org/proshin/finapi/account/FpAccountTest.java b/src/test/java/org/proshin/finapi/account/FpAccountTest.java index 535858a..05e7d06 100644 --- a/src/test/java/org/proshin/finapi/account/FpAccountTest.java +++ b/src/test/java/org/proshin/finapi/account/FpAccountTest.java @@ -28,10 +28,10 @@ import org.proshin.finapi.primitives.BankingInterface; import org.proshin.finapi.primitives.OffsetDateTimeOf; -public final class FpAccountTest extends TestWithMockedEndpoint { +final class FpAccountTest extends TestWithMockedEndpoint { @Test - public void testFields() { + void testFields() { final Account account = new FpAccount( this.endpoint(), new FakeAccessToken("secure user token"), diff --git a/src/test/java/org/proshin/finapi/account/FpAccountsTest.java b/src/test/java/org/proshin/finapi/account/FpAccountsTest.java index 0bd447e..570c235 100644 --- a/src/test/java/org/proshin/finapi/account/FpAccountsTest.java +++ b/src/test/java/org/proshin/finapi/account/FpAccountsTest.java @@ -26,10 +26,10 @@ import org.proshin.finapi.fake.FakeAccessToken; import org.proshin.finapi.primitives.OffsetDateTimeOf; -public final class FpAccountsTest extends TestWithMockedEndpoint { +final class FpAccountsTest extends TestWithMockedEndpoint { @Test - public void testOne() { + void testOne() { this.server() .when( HttpRequest.request("/api/v1/accounts/2") @@ -47,7 +47,7 @@ public void testOne() { } @Test - public void testQuery() { + void testQuery() { this.server() .when( HttpRequest.request("/api/v1/accounts") @@ -81,7 +81,7 @@ public void testQuery() { } @Test - public void testDailyBalances() { + void testDailyBalances() { this.server() .when( HttpRequest.request("/api/v1/accounts/dailyBalances") diff --git a/src/test/java/org/proshin/finapi/account/FpDirectDebitTest.java b/src/test/java/org/proshin/finapi/account/FpDirectDebitTest.java index 3218fe0..23357aa 100644 --- a/src/test/java/org/proshin/finapi/account/FpDirectDebitTest.java +++ b/src/test/java/org/proshin/finapi/account/FpDirectDebitTest.java @@ -26,10 +26,10 @@ import org.proshin.finapi.fake.FakeAccessToken; import org.proshin.finapi.primitives.LocalDateOf; -public final class FpDirectDebitTest extends TestWithMockedEndpoint { +final class FpDirectDebitTest extends TestWithMockedEndpoint { @Test - public void testRequest() { + void testRequest() { this.server() .when( HttpRequest.request("/api/v1/accounts/requestSepaDirectDebit") @@ -92,7 +92,7 @@ public void testRequest() { } @Test - public void testExecute() { + void testExecute() { this.server() .when( HttpRequest.request("/api/v1/accounts/executeSepaDirectDebit") diff --git a/src/test/java/org/proshin/finapi/account/FpMoneyTransferTest.java b/src/test/java/org/proshin/finapi/account/FpMoneyTransferTest.java index 767d0c7..6fa7913 100644 --- a/src/test/java/org/proshin/finapi/account/FpMoneyTransferTest.java +++ b/src/test/java/org/proshin/finapi/account/FpMoneyTransferTest.java @@ -27,10 +27,10 @@ import org.proshin.finapi.fake.FakeAccessToken; import org.proshin.finapi.primitives.LocalDateOf; -public final class FpMoneyTransferTest extends TestWithMockedEndpoint { +final class FpMoneyTransferTest extends TestWithMockedEndpoint { @Test - public void testRequest() { + void testRequest() { this.server() .when( HttpRequest.request("/api/v1/accounts/requestSepaMoneyTransfer") @@ -102,7 +102,7 @@ public void testRequest() { } @Test - public void testExecute() { + void testExecute() { this.server() .when( HttpRequest.request("/api/v1/accounts/executeSepaMoneyTransfer") diff --git a/src/test/java/org/proshin/finapi/account/TypeTest.java b/src/test/java/org/proshin/finapi/account/TypeTest.java index 99d0ead..c7bc8f6 100644 --- a/src/test/java/org/proshin/finapi/account/TypeTest.java +++ b/src/test/java/org/proshin/finapi/account/TypeTest.java @@ -22,19 +22,19 @@ import org.junit.jupiter.params.provider.CsvSource; import org.junit.jupiter.params.provider.ValueSource; -public final class TypeTest { +final class TypeTest { @ParameterizedTest @CsvSource({"1, Checking", "2, Savings", "3, CreditCard", "4, Security", "5, Loan", "6, Pocket", "7, Membership", "8, Bausparen" }) - public void testCorrectTypes(final int typeCode, @Nonnull final Type expectedType) { + void testCorrectTypes(final int typeCode, @Nonnull final Type expectedType) { assertThat(new TypeOf(typeCode).get()).isEqualTo(expectedType); } @ParameterizedTest @ValueSource(ints = {0, -1, 9, 10, 100}) - public void testIllegalCode(final int typeCode) { + void testIllegalCode(final int typeCode) { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> new TypeOf(typeCode).get()); } diff --git a/src/test/java/org/proshin/finapi/account/out/FpSepaExecutingResponseTest.java b/src/test/java/org/proshin/finapi/account/out/FpSepaExecutingResponseTest.java index f049f2a..d1a897c 100644 --- a/src/test/java/org/proshin/finapi/account/out/FpSepaExecutingResponseTest.java +++ b/src/test/java/org/proshin/finapi/account/out/FpSepaExecutingResponseTest.java @@ -20,10 +20,10 @@ import org.json.JSONObject; import org.junit.jupiter.api.Test; -public final class FpSepaExecutingResponseTest { +final class FpSepaExecutingResponseTest { @Test - public void test() { + void test() { final SepaExecutingResponse response = new FpSepaExecutingResponse( new JSONObject('{' + " \"successMessage\": \"Auftrag ausgeführt.\"," + diff --git a/src/test/java/org/proshin/finapi/account/out/FpSepaRequestingResponseTest.java b/src/test/java/org/proshin/finapi/account/out/FpSepaRequestingResponseTest.java index 8e30621..1d53cfb 100644 --- a/src/test/java/org/proshin/finapi/account/out/FpSepaRequestingResponseTest.java +++ b/src/test/java/org/proshin/finapi/account/out/FpSepaRequestingResponseTest.java @@ -20,10 +20,10 @@ import org.json.JSONObject; import org.junit.jupiter.api.Test; -public final class FpSepaRequestingResponseTest { +final class FpSepaRequestingResponseTest { @Test - public void test() { + void test() { final SepaRequestingResponse response = new FpSepaRequestingResponse(new JSONObject('{' + " \"successMessage\": \"Auftrag ausgeführt.\"," + " \"warnMessage\": \"Es liegen Warnungen vor.\"," + diff --git a/src/test/java/org/proshin/finapi/bank/BanksTest.java b/src/test/java/org/proshin/finapi/bank/BanksTest.java index 8282790..656aced 100644 --- a/src/test/java/org/proshin/finapi/bank/BanksTest.java +++ b/src/test/java/org/proshin/finapi/bank/BanksTest.java @@ -30,10 +30,10 @@ import org.proshin.finapi.primitives.paging.PagingCriteria; @SuppressWarnings("JUnitTestMethodWithNoAssertions") -public final class BanksTest extends TestWithMockedEndpoint { +final class BanksTest extends TestWithMockedEndpoint { @Test - public void testOne() { + void testOne() { this.server() .when( HttpRequest.request("/api/v1/banks/123") @@ -49,7 +49,7 @@ public void testOne() { } @Test - public void testSearch() { + void testSearch() { this.server() .when( HttpRequest.request("/api/v1/banks") diff --git a/src/test/java/org/proshin/finapi/bank/FpBankTest.java b/src/test/java/org/proshin/finapi/bank/FpBankTest.java index e4383ee..79800f6 100644 --- a/src/test/java/org/proshin/finapi/bank/FpBankTest.java +++ b/src/test/java/org/proshin/finapi/bank/FpBankTest.java @@ -116,7 +116,7 @@ public void test() { for (final BankInterface bankInterface : bank.interfaces()) { assertThat(bankInterface.bankingInterface()).isEqualTo(BankingInterface.FINTS_SERVER); - assertThat(bankInterface.tppAuthenticationGroup().isPresent()).isTrue(); + assertThat(bankInterface.tppAuthenticationGroup()).isPresent(); final TppAuthenticationGroup authenticationGroup = bankInterface.tppAuthenticationGroup().get(); assertThat(authenticationGroup.id()).isEqualTo(1L); assertThat(authenticationGroup.name()).isEqualTo("AirBank XS2A CZ"); @@ -141,7 +141,7 @@ public void test() { assertThat(bankInterface.isAisSupported()).isTrue(); } - assertThat(bank.bankGroup().isPresent()).isTrue(); + assertThat(bank.bankGroup()).isPresent(); final BankGroup bankGroup = bank.bankGroup().get(); assertThat(bankGroup.id()).isEqualTo(1L); assertThat(bankGroup.name()).isEqualTo("FinAPI Test Bank Group"); diff --git a/src/test/java/org/proshin/finapi/bankconnection/FpBankConnectionsTest.java b/src/test/java/org/proshin/finapi/bankconnection/FpBankConnectionsTest.java index 606b33d..41449c8 100644 --- a/src/test/java/org/proshin/finapi/bankconnection/FpBankConnectionsTest.java +++ b/src/test/java/org/proshin/finapi/bankconnection/FpBankConnectionsTest.java @@ -31,10 +31,10 @@ import org.proshin.finapi.bankconnection.in.UpdateBankConnectionParameters; import org.proshin.finapi.fake.FakeAccessToken; -public final class FpBankConnectionsTest extends TestWithMockedEndpoint { +final class FpBankConnectionsTest extends TestWithMockedEndpoint { @Test - public void testOne() { + void testOne() { this.server() .when( HttpRequest.request("/api/v1/bankConnections/42") @@ -50,7 +50,7 @@ public void testOne() { } @Test - public void testQuery() { + void testQuery() { this.server() .when( HttpRequest.request("/api/v1/bankConnections") @@ -70,7 +70,7 @@ public void testQuery() { } @Test - public void testImportNew() throws Exception { + void testImportNew() throws Exception { this.server() .when( HttpRequest.request("/api/v1/bankConnections/import") @@ -113,7 +113,7 @@ public void testImportNew() throws Exception { } @Test - public void testUpdate() throws Exception { + void testUpdate() throws Exception { this.server() .when( HttpRequest.request("/api/v1/bankConnections/update") @@ -147,7 +147,7 @@ public void testUpdate() throws Exception { } @Test - public void testDeleteAll() { + void testDeleteAll() { this.server() .when( HttpRequest.request("/api/v1/bankConnections") diff --git a/src/test/java/org/proshin/finapi/bankconnection/out/FpBankConsentTest.java b/src/test/java/org/proshin/finapi/bankconnection/out/FpBankConsentTest.java index 68adff6..cf5ab36 100644 --- a/src/test/java/org/proshin/finapi/bankconnection/out/FpBankConsentTest.java +++ b/src/test/java/org/proshin/finapi/bankconnection/out/FpBankConsentTest.java @@ -21,10 +21,10 @@ import static org.proshin.finapi.bankconnection.out.BankConsent.Status.PRESENT; import org.proshin.finapi.primitives.OffsetDateTimeOf; -public final class FpBankConsentTest { +final class FpBankConsentTest { @Test - public void test() { + void test() { final BankConsent consent = new FpBankConsent( new JSONObject( '{' + diff --git a/src/test/java/org/proshin/finapi/bankconnection/out/FpOwnerTest.java b/src/test/java/org/proshin/finapi/bankconnection/out/FpOwnerTest.java index 81b3071..c4f184f 100644 --- a/src/test/java/org/proshin/finapi/bankconnection/out/FpOwnerTest.java +++ b/src/test/java/org/proshin/finapi/bankconnection/out/FpOwnerTest.java @@ -21,9 +21,10 @@ import org.json.JSONObject; import org.junit.jupiter.api.Test; -public final class FpOwnerTest { +final class FpOwnerTest { + @Test - public void test() { + void test() { final Owner owner = new FpOwner( new JSONObject('{' + " \"firstName\": \"Max\"," + diff --git a/src/test/java/org/proshin/finapi/bankconnection/out/FpTwoStepProceduresTest.java b/src/test/java/org/proshin/finapi/bankconnection/out/FpTwoStepProceduresTest.java index 731d494..ea33257 100644 --- a/src/test/java/org/proshin/finapi/bankconnection/out/FpTwoStepProceduresTest.java +++ b/src/test/java/org/proshin/finapi/bankconnection/out/FpTwoStepProceduresTest.java @@ -19,10 +19,10 @@ import org.json.JSONObject; import org.junit.jupiter.api.Test; -public final class FpTwoStepProceduresTest { +final class FpTwoStepProceduresTest { @Test - public void testThatExceptionIsThrownIfDefaultDoesNotMatchAnyProcedure() { + void testThatExceptionIsThrownIfDefaultDoesNotMatchAnyProcedure() { final TwoStepProcedures twoStepProcedures = new FpTwoStepProcedures( new JSONObject('{' + " \"defaultTwoStepProcedureId\": \"000\"," + diff --git a/src/test/java/org/proshin/finapi/category/FpCategoriesTest.java b/src/test/java/org/proshin/finapi/category/FpCategoriesTest.java index 0b81ead..ae252be 100644 --- a/src/test/java/org/proshin/finapi/category/FpCategoriesTest.java +++ b/src/test/java/org/proshin/finapi/category/FpCategoriesTest.java @@ -36,10 +36,10 @@ import org.proshin.finapi.primitives.LocalDateOf; import org.proshin.finapi.primitives.paging.Page; -public final class FpCategoriesTest extends TestWithMockedEndpoint { +final class FpCategoriesTest extends TestWithMockedEndpoint { @Test - public void testOne() { + void testOne() { this.server() .when( HttpRequest.request("/api/v1/categories/378") @@ -56,7 +56,7 @@ public void testOne() { } @Test - public void testQuery() { + void testQuery() { this.server() .when( HttpRequest.request("/api/v1/categories") @@ -87,7 +87,7 @@ public void testQuery() { } @Test - public void testCashFlows() { + void testCashFlows() { this.server() .when( HttpRequest.request("/api/v1/categories/cashFlows") @@ -151,7 +151,7 @@ public void testCashFlows() { } @Test - public void testCreate() { + void testCreate() { this.server() .when( HttpRequest.request("/api/v1/categories") @@ -176,7 +176,7 @@ public void testCreate() { } @Test - public void testTrainCategorization() { + void testTrainCategorization() { this.server() .when( HttpRequest.request("/api/v1/categories/trainCategorization") @@ -224,7 +224,7 @@ public void testTrainCategorization() { } @Test - public void testDeleteAll() { + void testDeleteAll() { this.server() .when( HttpRequest.request("/api/v1/categories") diff --git a/src/test/java/org/proshin/finapi/category/FpCategoryTest.java b/src/test/java/org/proshin/finapi/category/FpCategoryTest.java index ce3de82..380ebfc 100644 --- a/src/test/java/org/proshin/finapi/category/FpCategoryTest.java +++ b/src/test/java/org/proshin/finapi/category/FpCategoryTest.java @@ -27,10 +27,10 @@ import org.proshin.finapi.category.in.FpEditParameters; import org.proshin.finapi.fake.FakeAccessToken; -public final class FpCategoryTest extends TestWithMockedEndpoint { +final class FpCategoryTest extends TestWithMockedEndpoint { @Test - public void test() { + void test() { final Category category = new FpCategory( this.endpoint(), new FakeAccessToken("test-user"), @@ -53,7 +53,7 @@ public void test() { } @Test - public void testEdit() { + void testEdit() { this.server() .when( HttpRequest.request("/api/v1/categories/378") @@ -72,7 +72,7 @@ public void testEdit() { } @Test - public void testDelete() { + void testDelete() { this.server().when( HttpRequest.request("/api/v1/categories/378") .withMethod("DELETE") diff --git a/src/test/java/org/proshin/finapi/category/out/FpCashFlowTest.java b/src/test/java/org/proshin/finapi/category/out/FpCashFlowTest.java index 8a0e8b4..865c363 100644 --- a/src/test/java/org/proshin/finapi/category/out/FpCashFlowTest.java +++ b/src/test/java/org/proshin/finapi/category/out/FpCashFlowTest.java @@ -22,10 +22,10 @@ import org.proshin.finapi.TestWithMockedEndpoint; import org.proshin.finapi.fake.FakeAccessToken; -public final class FpCashFlowTest extends TestWithMockedEndpoint { +final class FpCashFlowTest extends TestWithMockedEndpoint { @Test - public void test() { + void test() { final CashFlow cashFlow = new FpCashFlow( this.endpoint(), new FakeAccessToken("user-token"), @@ -51,7 +51,7 @@ public void test() { " }"), "/api/v1/accounts" ); - assertThat(cashFlow.category().isPresent()).isTrue(); + assertThat(cashFlow.category()).isPresent(); assertThat(cashFlow.category().get().id()).isEqualTo(378L); assertThat(cashFlow.income()).isEqualTo(new BigDecimal("199.99")); assertThat(cashFlow.spending()).isEqualTo(new BigDecimal("-99.99")); diff --git a/src/test/java/org/proshin/finapi/client/FpClientTest.java b/src/test/java/org/proshin/finapi/client/FpClientTest.java index 1a7def0..a6514e7 100644 --- a/src/test/java/org/proshin/finapi/client/FpClientTest.java +++ b/src/test/java/org/proshin/finapi/client/FpClientTest.java @@ -30,10 +30,10 @@ import org.proshin.finapi.user.Users; import org.proshin.finapi.user.in.FpCreateParameters; -public final class FpClientTest extends TestWithMockedEndpoint { +final class FpClientTest extends TestWithMockedEndpoint { @Test - public void testConfiguration() { + void testConfiguration() { this.server() .when( HttpRequest.request("/api/v1/clientConfiguration") @@ -100,7 +100,7 @@ public void testConfiguration() { */ @Test @SuppressWarnings("JUnitTestMethodWithNoAssertions") - public void testEdit() { + void testEdit() { this.server() .when( HttpRequest.request("/api/v1/clientConfiguration") @@ -158,7 +158,7 @@ public void testEdit() { @Test @SuppressWarnings("JUnitTestMethodWithNoAssertions") - public void testUsers() { + void testUsers() { this.server() .when( HttpRequest.request("/api/v1/users") diff --git a/src/test/java/org/proshin/finapi/exception/FinapiExceptionTest.java b/src/test/java/org/proshin/finapi/exception/FinapiExceptionTest.java index 75571b8..c2bd581 100644 --- a/src/test/java/org/proshin/finapi/exception/FinapiExceptionTest.java +++ b/src/test/java/org/proshin/finapi/exception/FinapiExceptionTest.java @@ -22,10 +22,10 @@ import org.proshin.finapi.bankconnection.out.TwoStepProcedure; import org.proshin.finapi.primitives.OffsetDateTimeOf; -public final class FinapiExceptionTest { +final class FinapiExceptionTest { @Test - public void test() { + void test() { final FinapiException exception = new FinapiException( "Test error message", new JSONObject('{' + diff --git a/src/test/java/org/proshin/finapi/label/FpLabelTest.java b/src/test/java/org/proshin/finapi/label/FpLabelTest.java index a945171..c4052ad 100644 --- a/src/test/java/org/proshin/finapi/label/FpLabelTest.java +++ b/src/test/java/org/proshin/finapi/label/FpLabelTest.java @@ -21,10 +21,10 @@ import org.proshin.finapi.TestWithMockedEndpoint; import org.proshin.finapi.fake.FakeAccessToken; -public final class FpLabelTest extends TestWithMockedEndpoint { +final class FpLabelTest extends TestWithMockedEndpoint { @Test - public void test() { + void test() { final Label label = new FpLabel( this.endpoint(), new FakeAccessToken("fake token"), diff --git a/src/test/java/org/proshin/finapi/label/LabelsTest.java b/src/test/java/org/proshin/finapi/label/LabelsTest.java index d94705e..79da433 100644 --- a/src/test/java/org/proshin/finapi/label/LabelsTest.java +++ b/src/test/java/org/proshin/finapi/label/LabelsTest.java @@ -24,10 +24,10 @@ import org.proshin.finapi.label.in.LabelsCriteria; import org.proshin.finapi.primitives.paging.Page; -public final class LabelsTest extends TestWithMockedEndpoint { +final class LabelsTest extends TestWithMockedEndpoint { @Test - public void testOne() { + void testOne() { this.server() .when( HttpRequest.request("/api/v1/labels/12") @@ -44,7 +44,7 @@ public void testOne() { } @Test - public void testQuery() { + void testQuery() { this.server() .when( HttpRequest.request("/api/v1/labels") diff --git a/src/test/java/org/proshin/finapi/mandator/FpMandatorTest.java b/src/test/java/org/proshin/finapi/mandator/FpMandatorTest.java index d85798d..d3acba8 100644 --- a/src/test/java/org/proshin/finapi/mandator/FpMandatorTest.java +++ b/src/test/java/org/proshin/finapi/mandator/FpMandatorTest.java @@ -25,10 +25,10 @@ import org.proshin.finapi.mandator.in.UsersCriteria; import org.proshin.finapi.primitives.OffsetDateTimeOf; -public final class FpMandatorTest extends TestWithMockedEndpoint { +final class FpMandatorTest extends TestWithMockedEndpoint { @Test - public void testUsers() { + void testUsers() { this.server() .when( HttpRequest.request("/api/v1/mandatorAdmin/getUserList") @@ -76,7 +76,7 @@ public void testUsers() { } @Test - public void testDeleteUsers() { + void testDeleteUsers() { this.server() .when( HttpRequest.request("/api/v1/mandatorAdmin/deleteUsers") @@ -101,7 +101,7 @@ public void testDeleteUsers() { } @Test - public void testChangeClientCredentials() { + void testChangeClientCredentials() { this.server() .when( HttpRequest.request("/api/v1/mandatorAdmin/changeClientCredentials") diff --git a/src/test/java/org/proshin/finapi/mandator/out/FpDeletionResultTest.java b/src/test/java/org/proshin/finapi/mandator/out/FpDeletionResultTest.java index f65faff..875a0c4 100644 --- a/src/test/java/org/proshin/finapi/mandator/out/FpDeletionResultTest.java +++ b/src/test/java/org/proshin/finapi/mandator/out/FpDeletionResultTest.java @@ -19,10 +19,10 @@ import org.json.JSONObject; import org.junit.jupiter.api.Test; -public final class FpDeletionResultTest { +final class FpDeletionResultTest { @Test - public void test() { + void test() { final DeletionResult result = new FpDeletionResult( new JSONObject('{' + " \"deletedUsers\": [" + diff --git a/src/test/java/org/proshin/finapi/mandator/out/FpUserTest.java b/src/test/java/org/proshin/finapi/mandator/out/FpUserTest.java index da1d5b3..482127e 100644 --- a/src/test/java/org/proshin/finapi/mandator/out/FpUserTest.java +++ b/src/test/java/org/proshin/finapi/mandator/out/FpUserTest.java @@ -22,10 +22,10 @@ import org.junit.jupiter.api.Test; import org.proshin.finapi.primitives.LocalDateOf; -public final class FpUserTest { +final class FpUserTest { @Test - public void test() { + void test() { final User user = new FpUser(new JSONObject('{' + " \"userId\": \"1\"," + " \"registrationDate\": \"2018-01-01\"," + diff --git a/src/test/java/org/proshin/finapi/mock/FpMocksAndTestsTest.java b/src/test/java/org/proshin/finapi/mock/FpMocksAndTestsTest.java index ff483c2..be9c4d3 100644 --- a/src/test/java/org/proshin/finapi/mock/FpMocksAndTestsTest.java +++ b/src/test/java/org/proshin/finapi/mock/FpMocksAndTestsTest.java @@ -34,10 +34,10 @@ import org.proshin.finapi.primitives.BankingInterface; @SuppressWarnings("JUnitTestMethodWithNoAssertions") -public final class FpMocksAndTestsTest extends TestWithMockedEndpoint { +final class FpMocksAndTestsTest extends TestWithMockedEndpoint { @Test - public void testMockBatchUpdate() { + void testMockBatchUpdate() { this.server() .when( HttpRequest.request("/api/v1/tests/mockBatchUpdate") @@ -62,7 +62,8 @@ public void testMockBatchUpdate() { " \"counterpartBic\": \"DRESDEFF700\"," + " \"counterpartAccountNumber\": \"61110500\"," + " \"bookingDate\": \"2018-01-01\"," + - " \"valueDate\": \"2018-02-02\"" + + " \"valueDate\": \"2018-02-02\"," + + " \"typeId\": 106" + " }" + " ]" + " }" + @@ -93,6 +94,7 @@ public void testMockBatchUpdate() { .withCounterpartAccountNumber("61110500") .withBookingDate(LocalDate.of(2018, 1, 1)) .withValueDate(LocalDate.of(2018, 2, 2)) + .withTypeId(106L) ) ), new Connection(43L, BankingInterface.FINTS_SERVER) @@ -101,7 +103,7 @@ public void testMockBatchUpdate() { } @Test - public void testCheckCategorization() { + void testCheckCategorization() { this.server() .when( HttpRequest.request("/api/v1/tests/checkCategorization") diff --git a/src/test/java/org/proshin/finapi/mock/out/FpCategorizationResultTest.java b/src/test/java/org/proshin/finapi/mock/out/FpCategorizationResultTest.java index f59a7fd..7fd66bf 100644 --- a/src/test/java/org/proshin/finapi/mock/out/FpCategorizationResultTest.java +++ b/src/test/java/org/proshin/finapi/mock/out/FpCategorizationResultTest.java @@ -21,10 +21,10 @@ import org.proshin.finapi.endpoint.FpEndpoint; import org.proshin.finapi.fake.FakeAccessToken; -public final class FpCategorizationResultTest { +final class FpCategorizationResultTest { @Test - public void test() { + void test() { final CategorizationResult result = new FpCategorizationResult( new FpEndpoint(""), new FakeAccessToken("user-token"), @@ -41,7 +41,7 @@ public void test() { '}'), "/some-url" ); - assertThat(result.category().isPresent()).isTrue(); + assertThat(result.category()).isPresent(); assertThat(result.category().get().id()).isEqualTo(378L); assertThat(result.transaction()).isEqualTo("transaction"); } diff --git a/src/test/java/org/proshin/finapi/notificationrule/FpNotificationRuleTest.java b/src/test/java/org/proshin/finapi/notificationrule/FpNotificationRuleTest.java index cb91022..e482f50 100644 --- a/src/test/java/org/proshin/finapi/notificationrule/FpNotificationRuleTest.java +++ b/src/test/java/org/proshin/finapi/notificationrule/FpNotificationRuleTest.java @@ -27,10 +27,10 @@ import org.proshin.finapi.TestWithMockedEndpoint; import org.proshin.finapi.fake.FakeAccessToken; -public final class FpNotificationRuleTest extends TestWithMockedEndpoint { +final class FpNotificationRuleTest extends TestWithMockedEndpoint { @Test - public void testWithParams() { + void testWithParams() { final NotificationRule rule = new FpNotificationRule( this.endpoint(), new FakeAccessToken("user-token"), @@ -53,7 +53,7 @@ public void testWithParams() { } @Test - public void testWithoutParams() { + void testWithoutParams() { final NotificationRule rule = new FpNotificationRule( this.endpoint(), new FakeAccessToken("user-token"), @@ -67,13 +67,13 @@ public void testWithoutParams() { ); assertThat(rule.id()).isEqualTo(1L); assertThat(rule.triggerEvent()).isEqualTo(TriggerEvent.NEW_ACCOUNT_BALANCE); - assertThat(rule.params().size()).isEqualTo(0); + assertThat(rule.params()).isEmpty(); assertThat(rule.callbackHandle()).isEqualTo(Optional.of("handle")); assertThat(rule.includeDetails()).isTrue(); } @Test - public void testDelete() { + void testDelete() { this.server() .when( HttpRequest.request("/api/v1/notificationRules/123") diff --git a/src/test/java/org/proshin/finapi/notificationrule/FpNotificationRulesTest.java b/src/test/java/org/proshin/finapi/notificationrule/FpNotificationRulesTest.java index b459fcb..b2e46ac 100644 --- a/src/test/java/org/proshin/finapi/notificationrule/FpNotificationRulesTest.java +++ b/src/test/java/org/proshin/finapi/notificationrule/FpNotificationRulesTest.java @@ -34,10 +34,10 @@ import org.proshin.finapi.notificationrule.in.params.NewAccountBalanceParams; import org.proshin.finapi.notificationrule.in.params.NewTransactionsParams; -public final class FpNotificationRulesTest extends TestWithMockedEndpoint { +final class FpNotificationRulesTest extends TestWithMockedEndpoint { @Test - public void testOne() { + void testOne() { this.server() .when( HttpRequest.request("/api/v1/notificationRules/123") @@ -54,7 +54,7 @@ public void testOne() { } @Test - public void testQuery() { + void testQuery() { this.server() .when( HttpRequest.request("/api/v1/notificationRules") @@ -79,7 +79,7 @@ public void testQuery() { } @Test - public void testCreateNewAccountBalance() { + void testCreateNewAccountBalance() { this.server() .when( HttpRequest.request("/api/v1/notificationRules") @@ -111,7 +111,7 @@ public void testCreateNewAccountBalance() { } @Test - public void testCreateNewTransactions() { + void testCreateNewTransactions() { this.server() .when( HttpRequest.request("/api/v1/notificationRules") @@ -145,7 +145,7 @@ public void testCreateNewTransactions() { } @Test - public void testCreateBankLoginError() { + void testCreateBankLoginError() { this.server() .when( HttpRequest.request("/api/v1/notificationRules") @@ -177,7 +177,7 @@ public void testCreateBankLoginError() { } @Test - public void testCreateForeignMoneyTransfer() { + void testCreateForeignMoneyTransfer() { this.server() .when( HttpRequest.request("/api/v1/notificationRules") @@ -209,7 +209,7 @@ public void testCreateForeignMoneyTransfer() { } @Test - public void testCreateLowAccountBalance() { + void testCreateLowAccountBalance() { this.server() .when( HttpRequest.request("/api/v1/notificationRules") @@ -243,7 +243,7 @@ public void testCreateLowAccountBalance() { } @Test - public void testCreateHighTransactionAmount() { + void testCreateHighTransactionAmount() { this.server() .when( HttpRequest.request("/api/v1/notificationRules") @@ -279,7 +279,7 @@ public void testCreateHighTransactionAmount() { } @Test - public void testCreateCategoryCashFlow() { + void testCreateCategoryCashFlow() { this.server() .when( HttpRequest.request("/api/v1/notificationRules") @@ -315,7 +315,7 @@ public void testCreateCategoryCashFlow() { } @Test - public void testCreateNewTermsAndConditions() { + void testCreateNewTermsAndConditions() { this.server() .when( HttpRequest.request("/api/v1/notificationRules") @@ -341,7 +341,7 @@ public void testCreateNewTermsAndConditions() { } @Test - public void testDeleteAll() { + void testDeleteAll() { this.server() .when( HttpRequest.request("/api/v1/notificationRules") diff --git a/src/test/java/org/proshin/finapi/notificationrule/in/CreatingParametersTest.java b/src/test/java/org/proshin/finapi/notificationrule/in/CreatingParametersTest.java index 5d85383..4baf0d6 100644 --- a/src/test/java/org/proshin/finapi/notificationrule/in/CreatingParametersTest.java +++ b/src/test/java/org/proshin/finapi/notificationrule/in/CreatingParametersTest.java @@ -21,10 +21,10 @@ import org.proshin.finapi.notificationrule.TriggerEvent; import org.proshin.finapi.notificationrule.in.params.BankLoginErrorParams; -public final class CreatingParametersTest { +final class CreatingParametersTest { @Test - public void testIncompatibleEventAndParams() { + void testIncompatibleEventAndParams() { assertThatExceptionOfType(RuntimeException.class) .isThrownBy( () -> new CreatingParameters(TriggerEvent.NEW_TRANSACTIONS) diff --git a/src/test/java/org/proshin/finapi/payment/FpPaymentsTest.java b/src/test/java/org/proshin/finapi/payment/FpPaymentsTest.java index a2228d5..5fccaa1 100644 --- a/src/test/java/org/proshin/finapi/payment/FpPaymentsTest.java +++ b/src/test/java/org/proshin/finapi/payment/FpPaymentsTest.java @@ -25,10 +25,10 @@ import org.proshin.finapi.payment.in.FpQueryCriteria; import org.proshin.finapi.primitives.paging.Page; -public final class FpPaymentsTest extends TestWithMockedEndpoint { +final class FpPaymentsTest extends TestWithMockedEndpoint { @Test - public void testQuery() { + void testQuery() { this.server() .when( HttpRequest.request("/api/v1/payments") diff --git a/src/test/java/org/proshin/finapi/primitives/BigDecimalOfTest.java b/src/test/java/org/proshin/finapi/primitives/BigDecimalOfTest.java index 51194b7..d37e438 100644 --- a/src/test/java/org/proshin/finapi/primitives/BigDecimalOfTest.java +++ b/src/test/java/org/proshin/finapi/primitives/BigDecimalOfTest.java @@ -22,28 +22,28 @@ import org.json.JSONObject; import org.junit.jupiter.api.Test; -public final class BigDecimalOfTest { +final class BigDecimalOfTest { @Test - public void testJsonDouble() { + void testJsonDouble() { assertThat(new BigDecimalOf(new JSONObject().put("key", -12.34), "key").get()) .isEqualTo(new BigDecimal("-12.34")); } @Test - public void testJsonInt() { + void testJsonInt() { assertThat(new BigDecimalOf(new JSONObject().put("key", -12), "key").get()) .isEqualTo(new BigDecimal("-12")); } @Test - public void testJsonString() { + void testJsonString() { assertThat(new BigDecimalOf(new JSONObject().put("key", "-12.34"), "key").get()) .isEqualTo(new BigDecimal("-12.34")); } @Test - public void testNullValue() { + void testNullValue() { final BigDecimalOf bigDecimalOf = new BigDecimalOf(new JSONObject(), "key"); assertThatThrownBy(bigDecimalOf::get) .isInstanceOf(IllegalStateException.class) @@ -51,7 +51,7 @@ public void testNullValue() { } @Test - public void testInvalidValue() { + void testInvalidValue() { final BigDecimalOf bigDecimalOf = new BigDecimalOf(new JSONObject().put("key", "abc"), "key"); assertThatThrownBy(bigDecimalOf::get) .isInstanceOf(JSONException.class) diff --git a/src/test/java/org/proshin/finapi/primitives/IterableJsonArrayTest.java b/src/test/java/org/proshin/finapi/primitives/IterableJsonArrayTest.java index 9eff083..25ab63f 100644 --- a/src/test/java/org/proshin/finapi/primitives/IterableJsonArrayTest.java +++ b/src/test/java/org/proshin/finapi/primitives/IterableJsonArrayTest.java @@ -22,10 +22,10 @@ import org.json.JSONArray; import org.junit.jupiter.api.Test; -public final class IterableJsonArrayTest { +final class IterableJsonArrayTest { @Test - public void testHasNext() { + void testHasNext() { final Iterator iterator = new IterableJsonArray<>( new JSONArray(new int[]{1}), JSONArray::getInt @@ -36,7 +36,7 @@ public void testHasNext() { } @Test - public void testNoSuchElementException() { + void testNoSuchElementException() { final Iterator iterator = new IterableJsonArray<>( new JSONArray(new int[]{1}), JSONArray::getInt diff --git a/src/test/java/org/proshin/finapi/primitives/StringOfTest.java b/src/test/java/org/proshin/finapi/primitives/StringOfTest.java index 26b34ed..c483286 100644 --- a/src/test/java/org/proshin/finapi/primitives/StringOfTest.java +++ b/src/test/java/org/proshin/finapi/primitives/StringOfTest.java @@ -21,17 +21,17 @@ import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.Test; -public final class StringOfTest { +final class StringOfTest { @Test - public void testStringOfOffsetDateTime() { - assertThat(new StringOf(OffsetDateTime.of(2018, 10, 25, 1, 2, 3, 4, ZoneOffset.UTC)).toString()) - .isEqualTo("2018-10-25"); + void testStringOfOffsetDateTime() { + assertThat(new StringOf(OffsetDateTime.of(2018, 10, 25, 1, 2, 3, 4, ZoneOffset.UTC))) + .hasToString("2018-10-25"); } @Test - public void testStringOfBigDecimal() { - assertThat(new StringOf(new BigDecimal("123456.012")).toString()) - .isEqualTo("123456.01"); + void testStringOfBigDecimal() { + assertThat(new StringOf(new BigDecimal("123456.012"))) + .hasToString("123456.01"); } } diff --git a/src/test/java/org/proshin/finapi/primitives/paging/FpPageTest.java b/src/test/java/org/proshin/finapi/primitives/paging/FpPageTest.java index 22e407a..96aea5d 100644 --- a/src/test/java/org/proshin/finapi/primitives/paging/FpPageTest.java +++ b/src/test/java/org/proshin/finapi/primitives/paging/FpPageTest.java @@ -22,10 +22,10 @@ import org.json.JSONObject; import org.junit.jupiter.api.Test; -public final class FpPageTest { +final class FpPageTest { @Test - public void testItems() throws Exception { + void testItems() throws Exception { final Page items = new FpPage<>( "items", new JSONObject('{' + @@ -41,7 +41,7 @@ public void testItems() throws Exception { } @Test - public void testPaging() { + void testPaging() { final Page items = new FpPage<>( "items", new JSONObject('{' + diff --git a/src/test/java/org/proshin/finapi/primitives/paging/FpPagingTest.java b/src/test/java/org/proshin/finapi/primitives/paging/FpPagingTest.java index c1b9c63..5253065 100644 --- a/src/test/java/org/proshin/finapi/primitives/paging/FpPagingTest.java +++ b/src/test/java/org/proshin/finapi/primitives/paging/FpPagingTest.java @@ -19,10 +19,10 @@ import org.json.JSONObject; import org.junit.jupiter.api.Test; -public final class FpPagingTest { +final class FpPagingTest { @Test - public void test() { + void test() { final Paging paging = new FpPaging( new JSONObject('{' + " \"page\": 1," + diff --git a/src/test/java/org/proshin/finapi/security/FpSecuritiesTest.java b/src/test/java/org/proshin/finapi/security/FpSecuritiesTest.java index b90581c..418b14f 100644 --- a/src/test/java/org/proshin/finapi/security/FpSecuritiesTest.java +++ b/src/test/java/org/proshin/finapi/security/FpSecuritiesTest.java @@ -23,10 +23,10 @@ import org.proshin.finapi.fake.FakeAccessToken; import org.proshin.finapi.security.in.SecuritiesCriteria; -public final class FpSecuritiesTest extends TestWithMockedEndpoint { +final class FpSecuritiesTest extends TestWithMockedEndpoint { @Test - public void testOne() { + void testOne() { this.server() .when( HttpRequest.request("/api/v1/securities/123") @@ -43,7 +43,7 @@ public void testOne() { } @Test - public void testQuery() { + void testQuery() { this.server() .when( HttpRequest.request("/api/v1/securities") diff --git a/src/test/java/org/proshin/finapi/security/FpSecurityTest.java b/src/test/java/org/proshin/finapi/security/FpSecurityTest.java index 71ab06c..8807f33 100644 --- a/src/test/java/org/proshin/finapi/security/FpSecurityTest.java +++ b/src/test/java/org/proshin/finapi/security/FpSecurityTest.java @@ -24,10 +24,10 @@ import org.proshin.finapi.security.out.QuantityNominalType; import org.proshin.finapi.security.out.QuoteType; -public final class FpSecurityTest { +final class FpSecurityTest { @Test - public void test() { + void test() { final Security security = new FpSecurity( new JSONObject('{' + " \"id\": 1," + diff --git a/src/test/java/org/proshin/finapi/tppcertificate/FpTppCertificateTest.java b/src/test/java/org/proshin/finapi/tppcertificate/FpTppCertificateTest.java index 310ded2..0e0b126 100644 --- a/src/test/java/org/proshin/finapi/tppcertificate/FpTppCertificateTest.java +++ b/src/test/java/org/proshin/finapi/tppcertificate/FpTppCertificateTest.java @@ -26,10 +26,10 @@ import org.proshin.finapi.fake.FakeAccessToken; import org.proshin.finapi.primitives.LocalDateOf; -public final class FpTppCertificateTest extends TestWithMockedEndpoint { +final class FpTppCertificateTest extends TestWithMockedEndpoint { @Test - public void test() { + void test() { final TppCertificate certificate = new FpTppCertificate( this.endpoint(), new FakeAccessToken("fake-access-token"), @@ -50,7 +50,7 @@ public void test() { } @Test - public void testDelete() { + void testDelete() { this.server().when( request() .withMethod("DELETE") diff --git a/src/test/java/org/proshin/finapi/tppcertificate/FpTppCertificatesTest.java b/src/test/java/org/proshin/finapi/tppcertificate/FpTppCertificatesTest.java index a26472b..1425993 100644 --- a/src/test/java/org/proshin/finapi/tppcertificate/FpTppCertificatesTest.java +++ b/src/test/java/org/proshin/finapi/tppcertificate/FpTppCertificatesTest.java @@ -25,10 +25,10 @@ import org.proshin.finapi.primitives.paging.Page; import org.proshin.finapi.tppcertificate.in.QueryTppCertificatesCriteria; -public final class FpTppCertificatesTest extends TestWithMockedEndpoint { +final class FpTppCertificatesTest extends TestWithMockedEndpoint { @Test - public void testOne() { + void testOne() { this.server() .when( HttpRequest.request() @@ -47,7 +47,7 @@ public void testOne() { } @Test - public void testQuery() { + void testQuery() { this.server() .when( HttpRequest.request() diff --git a/src/test/java/org/proshin/finapi/tppcertificate/in/CreateTppCertificateParametersTest.java b/src/test/java/org/proshin/finapi/tppcertificate/in/CreateTppCertificateParametersTest.java index f121250..98bd7ef 100644 --- a/src/test/java/org/proshin/finapi/tppcertificate/in/CreateTppCertificateParametersTest.java +++ b/src/test/java/org/proshin/finapi/tppcertificate/in/CreateTppCertificateParametersTest.java @@ -20,10 +20,10 @@ import org.proshin.finapi.primitives.LocalDateOf; import org.proshin.finapi.tppcertificate.CertificateType; -public final class CreateTppCertificateParametersTest { +final class CreateTppCertificateParametersTest { @Test - public void test() { + void test() { assertThat( new CreateTppCertificateParameters( CertificateType.QWAC, @@ -34,8 +34,8 @@ public void test() { .withPassphrase("custom passphrase") .withValidFromDate(new LocalDateOf("2019-11-29").get()) .withValidUntilDate(new LocalDateOf("2020-12-31").get()) - .asJson().toString()) - .isEqualTo('{' + + .asJson()) + .hasToString('{' + "\"privateKey\":\"private key\"," + "\"validFromDate\":\"2019-11-29\"," + "\"passphrase\":\"custom passphrase\"," + diff --git a/src/test/java/org/proshin/finapi/tppcredential/FpTppAuthenticationGroupTest.java b/src/test/java/org/proshin/finapi/tppcredential/FpTppAuthenticationGroupTest.java index 050eaf8..7f9ec11 100644 --- a/src/test/java/org/proshin/finapi/tppcredential/FpTppAuthenticationGroupTest.java +++ b/src/test/java/org/proshin/finapi/tppcredential/FpTppAuthenticationGroupTest.java @@ -25,10 +25,10 @@ import org.proshin.finapi.primitives.paging.Page; import org.proshin.finapi.tppcredential.in.QueryTppAuthenticationGroupsCriteria; -public final class FpTppAuthenticationGroupTest extends TestWithMockedEndpoint { +final class FpTppAuthenticationGroupTest extends TestWithMockedEndpoint { @Test - public void testQuery() { + void testQuery() { this.server() .when( HttpRequest.request() diff --git a/src/test/java/org/proshin/finapi/tppcredential/FpTppCredentialTest.java b/src/test/java/org/proshin/finapi/tppcredential/FpTppCredentialTest.java index 984fef1..0b884d1 100644 --- a/src/test/java/org/proshin/finapi/tppcredential/FpTppCredentialTest.java +++ b/src/test/java/org/proshin/finapi/tppcredential/FpTppCredentialTest.java @@ -26,10 +26,10 @@ import org.proshin.finapi.fake.FakeAccessToken; import org.proshin.finapi.primitives.LocalDateOf; -public final class FpTppCredentialTest extends TestWithMockedEndpoint { +final class FpTppCredentialTest extends TestWithMockedEndpoint { @Test - public void test() { + void test() { final TppCredential credential = new FpTppCredential( this.endpoint(), new FakeAccessToken("fake-access-token"), @@ -50,7 +50,7 @@ public void test() { } @Test - public void testDelete() { + void testDelete() { this.server().when( request() .withMethod("DELETE") diff --git a/src/test/java/org/proshin/finapi/tppcredential/FpTppCredentialsTest.java b/src/test/java/org/proshin/finapi/tppcredential/FpTppCredentialsTest.java index a1a1eca..71ccb6d 100644 --- a/src/test/java/org/proshin/finapi/tppcredential/FpTppCredentialsTest.java +++ b/src/test/java/org/proshin/finapi/tppcredential/FpTppCredentialsTest.java @@ -28,10 +28,10 @@ import org.proshin.finapi.tppcredential.in.EditTppCredentialParameters; import org.proshin.finapi.tppcredential.in.QueryTppCredentialsCriteria; -public final class FpTppCredentialsTest extends TestWithMockedEndpoint { +final class FpTppCredentialsTest extends TestWithMockedEndpoint { @Test - public void testOne() { + void testOne() { this.server() .when( HttpRequest.request() @@ -50,7 +50,7 @@ public void testOne() { } @Test - public void testQuery() { + void testQuery() { this.server() .when( HttpRequest.request() @@ -94,7 +94,7 @@ public void testQuery() { } @Test - public void testEdit() { + void testEdit() { this.server() .when( HttpRequest.request("/api/v1/tppCredentials/378") diff --git a/src/test/java/org/proshin/finapi/tppcredential/in/CreateTppCredentialParametersTest.java b/src/test/java/org/proshin/finapi/tppcredential/in/CreateTppCredentialParametersTest.java index 7114e0a..c354ec4 100644 --- a/src/test/java/org/proshin/finapi/tppcredential/in/CreateTppCredentialParametersTest.java +++ b/src/test/java/org/proshin/finapi/tppcredential/in/CreateTppCredentialParametersTest.java @@ -19,10 +19,10 @@ import org.junit.jupiter.api.Test; import org.proshin.finapi.primitives.LocalDateOf; -public final class CreateTppCredentialParametersTest { +final class CreateTppCredentialParametersTest { @Test - public void test() { + void test() { assertThat( new CreateTppCredentialParameters(99L, "custom label") .withTppClientId("custom client id") @@ -31,8 +31,8 @@ public void test() { .withTppName("custom name") .withValidFromDate(new LocalDateOf("2019-01-22").get()) .withValidUntilDate(new LocalDateOf("2020-01-31").get()) - .asJson().toString()) - .isEqualTo('{' + + .asJson()) + .hasToString('{' + "\"tppClientId\":\"custom client id\"," + "\"validFromDate\":\"2019-01-22\"," + "\"label\":\"custom label\"," + diff --git a/src/test/java/org/proshin/finapi/transaction/FpTransactionTest.java b/src/test/java/org/proshin/finapi/transaction/FpTransactionTest.java index 1fab1e7..0d2bf6a 100644 --- a/src/test/java/org/proshin/finapi/transaction/FpTransactionTest.java +++ b/src/test/java/org/proshin/finapi/transaction/FpTransactionTest.java @@ -32,10 +32,10 @@ import org.proshin.finapi.transaction.in.SplitTransactionParameters; import org.proshin.finapi.transaction.in.Subtransaction; -public final class FpTransactionTest extends TestWithMockedEndpoint { +final class FpTransactionTest extends TestWithMockedEndpoint { @Test - public void test() { + void test() { final Transaction tx = new FpTransaction( this.endpoint(), new FakeAccessToken("user-token"), @@ -127,7 +127,7 @@ public void test() { assertThat(tx.type().typeCodeSwift()).isEqualTo(Optional.of("RAPRDE51")); assertThat(tx.sepaPurposeCode()).isEqualTo(Optional.of("OTHR")); assertThat(tx.primanota()).isEqualTo(Optional.of("Primanota")); - assertThat(tx.category().isPresent()).isTrue(); + assertThat(tx.category()).isPresent(); assertThat(tx.category().get().id()).isEqualTo(4L); tx.labels().forEach(label -> { assertThat(label.id()).isEqualTo(1L); @@ -138,7 +138,7 @@ public void test() { assertThat(tx.isNew()).isTrue(); assertThat(tx.importDate()).isEqualTo(new OffsetDateTimeOf("2018-01-01 00:00:00.000").get()); assertThat(tx.children()).containsExactlyInAnyOrder(1L, 2L, 3L); - assertThat(tx.payPalData().isPresent()).isTrue(); + assertThat(tx.payPalData()).isPresent(); assertThat(tx.payPalData().get().invoiceNumber()).isEqualTo(Optional.of("INV2-KXVU-7Z64-DT6W-MG2X")); assertThat(tx.payPalData().get().fee()).isEqualTo(Optional.of(new BigDecimal("-0.99"))); assertThat(tx.payPalData().get().net()).isEqualTo(Optional.of(new BigDecimal("9.99"))); @@ -151,7 +151,7 @@ public void test() { } @Test - public void testSplit() { + void testSplit() { this.server() .when( HttpRequest.request("/api/v1/transactions/123/split") @@ -202,7 +202,7 @@ public void testSplit() { } @Test - public void testRestore() { + void testRestore() { this.server() .when( HttpRequest.request("/api/v1/transactions/123/restore") @@ -221,7 +221,7 @@ public void testRestore() { } @Test - public void testEdit() { + void testEdit() { this.server() .when( HttpRequest.request("/api/v1/transactions/123") @@ -258,7 +258,7 @@ public void testEdit() { } @Test - public void testDelete() { + void testDelete() { this.server() .when( HttpRequest.request("/api/v1/transactions/123") diff --git a/src/test/java/org/proshin/finapi/transaction/FpTransactionsTest.java b/src/test/java/org/proshin/finapi/transaction/FpTransactionsTest.java index 44f6ca2..c3b7425 100644 --- a/src/test/java/org/proshin/finapi/transaction/FpTransactionsTest.java +++ b/src/test/java/org/proshin/finapi/transaction/FpTransactionsTest.java @@ -32,10 +32,10 @@ import org.proshin.finapi.transaction.in.TransactionsCriteria; import org.proshin.finapi.transaction.out.TransactionsPage; -public final class FpTransactionsTest extends TestWithMockedEndpoint { +final class FpTransactionsTest extends TestWithMockedEndpoint { @Test - public void testOne() { + void testOne() { this.server() .when( HttpRequest.request("/api/v1/transactions/123") @@ -50,7 +50,7 @@ public void testOne() { } @Test - public void testQuery() { + void testQuery() { this.server() .when( HttpRequest.request("/api/v1/transactions") @@ -133,7 +133,7 @@ public void testQuery() { } @Test - public void testEdit() { + void testEdit() { this.server() .when( HttpRequest.request("/api/v1/transactions") @@ -166,7 +166,7 @@ public void testEdit() { } @Test - public void testTriggerCategorization() { + void testTriggerCategorization() { this.server() .when( HttpRequest.request("/api/v1/transactions/triggerCategorization") @@ -182,7 +182,7 @@ public void testTriggerCategorization() { } @Test - public void testDeleteAll() { + void testDeleteAll() { this.server() .when( HttpRequest.request("/api/v1/transactions") diff --git a/src/test/java/org/proshin/finapi/user/UsersTest.java b/src/test/java/org/proshin/finapi/user/UsersTest.java index 031b47d..114d616 100644 --- a/src/test/java/org/proshin/finapi/user/UsersTest.java +++ b/src/test/java/org/proshin/finapi/user/UsersTest.java @@ -25,10 +25,10 @@ import org.proshin.finapi.fake.FakeAccessToken; import org.proshin.finapi.user.in.FpCreateParameters; -public final class UsersTest extends TestWithMockedEndpoint { +final class UsersTest extends TestWithMockedEndpoint { @Test - public void testAuthorized() { + void testAuthorized() { this.server() .when( request("/api/v1/users") @@ -45,7 +45,7 @@ public void testAuthorized() { } @Test - public void testVerified() { + void testVerified() { this.server() .when( request("/api/v1/users/verificationStatus") @@ -66,7 +66,7 @@ public void testVerified() { } @Test - public void testCreate() { + void testCreate() { this.server() .when( request("/api/v1/users") @@ -97,7 +97,7 @@ public void testCreate() { } @Test - public void testRequestPasswordChange() { + void testRequestPasswordChange() { this.server() .when( request("/api/v1/users/requestPasswordChange") @@ -123,7 +123,7 @@ public void testRequestPasswordChange() { @Test @SuppressWarnings("JUnitTestMethodWithNoAssertions") - public void testExecutePasswordChange() { + void testExecutePasswordChange() { this.server() .when( request("/api/v1/users/executePasswordChange") @@ -146,7 +146,7 @@ public void testExecutePasswordChange() { @Test @SuppressWarnings("JUnitTestMethodWithNoAssertions") - public void testVerify() { + void testVerify() { this.server() .when( request("/api/v1/users/verify/user-1") @@ -164,7 +164,7 @@ public void testVerify() { @Test @SuppressWarnings("JUnitTestMethodWithNoAssertions") - public void testDeleteUnverified() { + void testDeleteUnverified() { this.server() .when( request("/api/v1/users/user-1") diff --git a/src/test/java/org/proshin/finapi/webform/FpWebFormTest.java b/src/test/java/org/proshin/finapi/webform/FpWebFormTest.java index 6520684..4455ad6 100644 --- a/src/test/java/org/proshin/finapi/webform/FpWebFormTest.java +++ b/src/test/java/org/proshin/finapi/webform/FpWebFormTest.java @@ -20,10 +20,10 @@ import org.json.JSONObject; import org.junit.jupiter.api.Test; -public final class FpWebFormTest { +final class FpWebFormTest { @Test - public void testSuccess() { + void testSuccess() { final WebForm webForm = new FpWebForm( new JSONObject( '{' + diff --git a/src/test/java/org/proshin/finapi/webform/WebFormsTest.java b/src/test/java/org/proshin/finapi/webform/WebFormsTest.java index 1bcec88..4e8193e 100644 --- a/src/test/java/org/proshin/finapi/webform/WebFormsTest.java +++ b/src/test/java/org/proshin/finapi/webform/WebFormsTest.java @@ -21,10 +21,10 @@ import org.proshin.finapi.TestWithMockedEndpoint; import org.proshin.finapi.fake.FakeAccessToken; -public final class WebFormsTest extends TestWithMockedEndpoint { +final class WebFormsTest extends TestWithMockedEndpoint { @Test - public void testOne() { + void testOne() { this.server() .when( HttpRequest.request("/api/v1/webForms/12")