@Test
	public void testBatchTranslateRequest() throws IOException {
		int batchSize = 2;
		HttpServer server = createMockHttpServer();
		server.createContext("/translate", this::mockTranslateHandler);
		try {
			server.start();
			LibreTranslateStringTranslationService sts =
				new LibreTranslateStringTranslationService(getURI(server.getAddress()), null, AUTO,
					"en", batchSize, 1000, 1000);

			List<ProgramLocation> stringLocs = strings.stream()
					.map(data -> new ProgramLocation(program, data.getAddress()))
					.toList();
			int expectedBatchCount = stringLocs.size() / batchSize;
			expectedBatchCount += (stringLocs.size() % batchSize != 0 ? 1 : 0);

			Swing.runNow(() -> sts.translate(program, stringLocs, TranslateOptions.NONE));

			assertEquals(translateRequestCount.get(), expectedBatchCount);
			assertEquals(translateStringCount.get(), stringLocs.size());
			waitForTasks();
		}
		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