Test is more resilient to external service failures
This commit is contained in:
parent
1424b10942
commit
19e98cef4b
|
@ -8,14 +8,20 @@ import org.gcube.keycloak.oidc.avatar.importer.libravatar.Libravatar;
|
|||
import org.gcube.keycloak.oidc.avatar.importer.libravatar.LibravatarDefaultImage;
|
||||
import org.gcube.keycloak.oidc.avatar.importer.libravatar.LibravatarException;
|
||||
import org.gcube.keycloak.oidc.avatar.importer.libravatar.LibravatarOptions;
|
||||
import org.junit.AssumptionViolatedException;
|
||||
import org.junit.Test;
|
||||
|
||||
public class AvatarTest {
|
||||
|
||||
@Test
|
||||
public void testOK() throws LibravatarException {
|
||||
public void testOK() {
|
||||
try {
|
||||
InputStream is = Libravatar.from("mauro.mugnaini@nubisware.com").withOptions(new LibravatarOptions().withHttps()).download();
|
||||
assertNotNull(is);
|
||||
} catch (LibravatarException e) {
|
||||
// Remote system is not working properly
|
||||
throw new AssumptionViolatedException("Cannot connect with external service", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Test(expected = LibravatarException.class)
|
||||
|
|
Loading…
Reference in New Issue