Fixed test to match on instances of IOException.
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
-import java.io.EOFException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import org.bouncycastle.est.Source;
import org.bouncycastle.est.jcajce.JcaJceUtils;
import org.bouncycastle.est.jcajce.JsseESTServiceBuilder;
-import org.bouncycastle.jsse.provider.BouncyCastleJsseProvider;
import org.bouncycastle.test.est.examples.ExampleUtils;
import org.bouncycastle.util.Store;
import org.bouncycastle.util.io.pem.PemReader;
@@ -259,8 +257,6 @@ public void testFetchCaCertsWithBogusTrustAnchor()
}
-
-
/**
* Fetch CA certs relying on TLS to validate the server by specifying a trust anchor.
*
@@ -684,7 +680,7 @@ public boolean isTrusted()
catch (Exception ex)
{
Assert.assertEquals("Expect EST Exception", ESTException.class, ex.getClass());
- Assert.assertEquals("Expect cause an IOException", EOFException.class, ex.getCause().getClass());
+ Assert.assertTrue("Expect cause an IOException", ex.getCause() instanceof IOException);
}
}
