/*
 * This file is part of Bisq.
 *
 * Bisq is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at
 * your option) any later version.
 *
 * Bisq is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Bisq. If not, see <http://www.gnu.org/licenses/>.
 */

package bisq.core.payment.validation;

import bisq.core.app.BisqEnvironment;
import bisq.core.btc.BaseCurrencyNetwork;
import bisq.core.locale.CurrencyUtil;
import bisq.core.locale.Res;

import org.junit.Test;

import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;



import bisq.asset.AssetRegistry;

public class AltCoinAddressValidatorTest {

    @Test
    public void test() {
        AltCoinAddressValidator validator = new AltCoinAddressValidator(new AssetRegistry());

        BaseCurrencyNetwork baseCurrencyNetwork = BisqEnvironment.getBaseCurrencyNetwork();
        String currencyCode = baseCurrencyNetwork.getCurrencyCode();
        Res.setBaseCurrencyCode(currencyCode);
        Res.setBaseCurrencyName(baseCurrencyNetwork.getCurrencyName());
        CurrencyUtil.setBaseCurrencyCode(currencyCode);

        validator.setCurrencyCode("BTC");
        assertTrue(validator.validate("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhem").isValid);

        validator.setCurrencyCode("LTC");
        assertTrue(validator.validate("Lg3PX8wRWmApFCoCMAsPF5P9dPHYQHEWKW").isValid);

        validator.setCurrencyCode("BOGUS");
        try {
            validator.validate("1BOGUSADDR");
            fail("expected validation to fail for unregistered asset 'BOGUS'");
        } catch (IllegalArgumentException ex) {
            assertThat(ex.getMessage(), containsString("'BOGUS' is not a registered asset"));
        }
    }
}

@@ -890,64 +890,8 @@
 t;%0A%0A
-import static org.hamcrest.CoreMatchers.containsString;%0A
 impo
@@ -923,20 +923,21 @@
 t.assert
-That
+False
 ;%0Aimport
@@ -977,45 +977,8 @@
 ue;%0A
-import static org.junit.Assert.fail;%0A
 %0A%0A%0Ai
@@ -1823,24 +1823,25 @@
 OGUS%22);%0A
+%0A
         
 try %7B%0A  
@@ -1836,26 +1836,20 @@
     
-try %7B%0A            
+assertFalse(
 vali
@@ -1880,241 +1880,18 @@
 DR%22)
-;%0A            fail(%22expected validation to fail for unregistered asset 'BOGUS'%22);%0A        %7D catch (IllegalArgumentException ex) %7B%0A            assertThat(ex.getMessage(), containsString(%22'BOGUS' is not a registered asset%22));%0A        %7D
+.isValid);
 %0A   

Fix failing test