This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.InvocationHandler; | |
import java.lang.reflect.Proxy; | |
import io.github.resilience4j.retry.Retry; | |
public final class WebserviceFactory{ | |
static <T> T decorateWithRetryer(final T service, Retry retry) { | |
InvocationHandler invocationHandler = (proxy, method, args) -> retry.executeCheckedSupplier(() -> method.invoke(service, args)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JschExec { | |
private static String runCommand(Session session, String command, String... input) throws JSchException, IOException { | |
ChannelExec channel = (ChannelExec) session.openChannel("exec"); | |
try { | |
channel.setCommand(command); | |
logger.debug("running command: {}", command); | |
final InputStream in = channel.getInputStream(); | |
final InputStream errStream = channel.getErrStream(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.matez.client; | |
import static org.junit.Assert.fail; | |
import static org.mockito.Matchers.any; | |
import static org.mockito.Mockito.times; | |
import static org.mockito.Mockito.verify; | |
import static org.mockito.Mockito.when; | |
import java.io.IOException; | |
import java.net.UnknownHostException; |
OlderNewer