@Test
    public void testSimpleTranslate() {
        String source = "hola senor";
        String expected = "hello sir";

        String result = null;
        if (translator.isAvailable()) {
            try {
                result = translator.translate(source, "es", "en");
                assertNotNull(result);
                assertEquals(expected, result,
                        "Result: [" + result + "]: not equal to expected: [" + expected + "]");
            } catch (Exception e) {
                e.printStackTrace();
                fail(e.getMessage());
            }
        }
    }
Test harness for the {@link GoogleTranslator}.
tika-translate/src/test/java/org/apache/tika/language/translate/impl/GoogleTranslatorTest.java