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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import os | |
from ftplib import FTP | |
########### Local Path #################### | |
path = 'backup/' | |
########### MODIFY ######################## |
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
group 'seleniumvnc' | |
version '1.0-SNAPSHOT' | |
apply plugin: 'java' | |
sourceCompatibility = 1.8 | |
repositories { | |
mavenCentral() | |
} |
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
public class TestSelenium { | |
@Rule | |
public BrowserWebDriverContainer chrome = new BrowserWebDriverContainer() | |
.withDesiredCapabilities(DesiredCapabilities.chrome()) | |
.withRecordingMode(BrowserWebDriverContainer.VncRecordingMode.RECORD_FAILING, new File("target")); | |
@Test | |
public void searchTest() { | |
RemoteWebDriver driver = chrome.getWebDriver(); |
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
buildscript { | |
ext { | |
springBootVersion = '1.5.10.RELEASE' | |
} | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") | |
} |
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
public interface TranslateService { | |
String translate(String text, Language sourceLang, Language targetLang); | |
} |
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
@Slf4j | |
@Service | |
public class AmazonTranslateImpl implements TranslateService { | |
private final AwsConfig config; | |
private AmazonTranslate client; | |
public AmazonTranslateImpl(AwsConfig config) { | |
this.config = config; | |
} |
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
@SpringBootTest | |
class TranslateServiceTest extends Specification { | |
@Autowired | |
TranslateService translateService | |
def "translate text expected succeed"() { | |
when: | |
def result = translateService.translate("Hello World", Language.ENGLISH, Language.SPANISH) | |
then: | |
result == "Hola Mundo" |