Skip to content

Instantly share code, notes, and snippets.

View BatuhanKucukali's full-sized avatar
🎯
Focusing

Batuhan Küçükali BatuhanKucukali

🎯
Focusing
View GitHub Profile
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from ftplib import FTP
########### Local Path ####################
path = 'backup/'
########### MODIFY ########################
group 'seleniumvnc'
version '1.0-SNAPSHOT'
apply plugin: 'java'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
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();
buildscript {
ext {
springBootVersion = '1.5.10.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
public interface TranslateService {
String translate(String text, Language sourceLang, Language targetLang);
}
@Slf4j
@Service
public class AmazonTranslateImpl implements TranslateService {
private final AwsConfig config;
private AmazonTranslate client;
public AmazonTranslateImpl(AwsConfig config) {
this.config = config;
}
@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"