Search in sources :

Example 1 with ConfirmationProviderService

use of com.github.robozonky.api.confirmations.ConfirmationProviderService in project robozonky by RoboZonky.

the class ConfirmationProviderLoaderTest method loading.

@Test
void loading() {
    final String id = UUID.randomUUID().toString();
    final ConfirmationProvider cp = new ConfirmationProvider() {

        @Override
        public boolean requestConfirmation(final RequestId auth, final int loanId, final int amount) {
            return false;
        }

        @Override
        public String getId() {
            return id;
        }
    };
    final ConfirmationProviderService cps = strategy -> Optional.of(cp);
    assertThat(ConfirmationProviderLoader.load(id, Collections.singleton(cps))).contains(cp);
}
Also used : ConfirmationProviderService(com.github.robozonky.api.confirmations.ConfirmationProviderService) Test(org.junit.jupiter.api.Test) ConfirmationProviderService(com.github.robozonky.api.confirmations.ConfirmationProviderService) RequestId(com.github.robozonky.api.confirmations.RequestId) Optional(java.util.Optional) Assertions(org.assertj.core.api.Assertions) UUID(java.util.UUID) ConfirmationProvider(com.github.robozonky.api.confirmations.ConfirmationProvider) Collections(java.util.Collections) RequestId(com.github.robozonky.api.confirmations.RequestId) ConfirmationProvider(com.github.robozonky.api.confirmations.ConfirmationProvider) Test(org.junit.jupiter.api.Test)

Aggregations

ConfirmationProvider (com.github.robozonky.api.confirmations.ConfirmationProvider)1 ConfirmationProviderService (com.github.robozonky.api.confirmations.ConfirmationProviderService)1 RequestId (com.github.robozonky.api.confirmations.RequestId)1 Collections (java.util.Collections)1 Optional (java.util.Optional)1 UUID (java.util.UUID)1 Assertions (org.assertj.core.api.Assertions)1 Test (org.junit.jupiter.api.Test)1