@SuppressWarnings("unchecked")
	@Test
	public void testPromptForSourceLangTranslateRequest() throws IOException, CancelledException {
		HttpServer server = createMockHttpServer();
		server.createContext("/translate", this::mockTranslateHandler);
		server.createContext("/languages", this::mockLangHandler);

		try {
			server.start();
			LibreTranslateStringTranslationService sts =
				new LibreTranslateStringTranslationService(getURI(server.getAddress()), null,
					SOURCE_LANGUAGE_OPTION.PROMPT, "en", 100, 1000, 1000);
			List<SupportedLanguage> langs = sts.getSupportedLanguages(TaskMonitor.DUMMY);
			SupportedLanguage langToPick = langs.get(1);

			Swing.runLater(
				() -> sts.translate(program, List.of(progLoc(0)), TranslateOptions.NONE));

			@SuppressWarnings({ "rawtypes" })
			SelectFromListDialog selectDlg = waitForDialogComponent(SelectFromListDialog.class);

			Swing.runNow(() -> selectDlg.setSelectedObject(langToPick.getDescription()));
			Swing.runNow(() -> pressButtonByText(selectDlg, "OK"));

			waitForTasks();

			assertEquals(translateRequestCount.get(), 1);
			assertEquals(1, translateSourceLangs.size());
			assertEquals(langToPick.langCode(), translateSourceLangs.get(0));
		}
		finally {
			server.stop(0);
		}
	}
Tests the LibreTranslateStringTranslationService by creating a mock HTTP server that responds
to the minimal requests the service needs.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/string/translate/libretranslate/LibreTranslateStringTranslationServiceTest.java