org.openqa.selenium.logging.LogEntries Java Examples
The following examples show how to use
org.openqa.selenium.logging.LogEntries.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ConsoleTest.java From htmlunit with Apache License 2.0 | 6 votes |
/** * @throws Exception if the test fails */ @Test @BuggyWebDriver public void assertObjects() throws Exception { final String html = "<html>\n" + "<body>\n" + "<script>\n" + " number = 1;\n" + " console.assert(number % 2 === 0, {number: number}, {errorMsg: 'the # is not even'});\n" + "</script>\n" + "</body></html>"; final WebDriver driver = loadPage2(html); final Logs logs = driver.manage().logs(); final LogEntries logEntries = logs.get(LogType.BROWSER); final List<LogEntry> logEntryList = logEntries.getAll(); assertEquals(1, logEntryList.size()); final LogEntry logEntry = logEntryList.get(0); assertTrue(logEntry.getMessage(), logEntry.getMessage() .contains("Assertion failed: ({number: 1.0}) ({errorMsg: \"the # is not even\"})")); }
Example #2
Source File: CustomEventListener.java From seleniumtestsframework with Apache License 2.0 | 6 votes |
private void logErrors(String event, WebElement element, LogEntries logEntries) { if (logEntries.getAll().size() == 0) { TestLogging.log("********* No Severe Error on Browser Console *********", true); } else { for (LogEntry logEntry : logEntries) { if (logEntry.getLevel().equals(Level.SEVERE)) { TestLogging.log("Sever Console Error on Browser "+event+" clicking " + "element: " +((HtmlElement)element).getBy()); TestLogging.logWebStep("Time stamp: " + logEntry.getTimestamp() + ", " + "Log level: " + logEntry .getLevel() + ", Log message: " + logEntry.getMessage(), true); isJSErrorFound = true; } } assert !isJSErrorFound; } }
Example #3
Source File: CustomEventListener.java From seleniumtestsframework with Apache License 2.0 | 6 votes |
private void logErrors(String url, LogEntries logEntries) { if (logEntries.getAll().size() == 0) { TestLogging.log("********* No Severe Error on Browser Console *********", true); } else { for (LogEntry logEntry : logEntries) { if (logEntry.getLevel().equals(Level.SEVERE)) { TestLogging.log("URL: "+url); TestLogging.logWebStep("Time stamp: " + logEntry.getTimestamp() + ", " + "Log level: " + logEntry .getLevel() + ", Log message: " + logEntry.getMessage(), true); isJSErrorFound = true; } } assert !isJSErrorFound; } }
Example #4
Source File: WebComponentsIT.java From flow with Apache License 2.0 | 6 votes |
@Test public void testPolyfillLoaded() { open(); if (BrowserUtil.isIE(getDesiredCapabilities())) { // Console logs are not available from IE11 return; } LogEntries logs = driver.manage().logs().get("browser"); if (logs != null) { Optional<LogEntry> anyError = StreamSupport .stream(logs.spliterator(), true) .filter(entry -> entry.getLevel().intValue() > Level.INFO .intValue()) .filter(entry -> !entry.getMessage() .contains("favicon.ico")) .filter(entry -> !entry.getMessage() .contains("sockjs-node")) .filter(entry -> !entry.getMessage() .contains("[WDS] Disconnected!")) .findAny(); anyError.ifPresent(entry -> Assert.fail(entry.getMessage())); } }
Example #5
Source File: APPIUMCloudActionProvider.java From xframium-java with GNU General Public License v3.0 | 6 votes |
@Override public String getLog( DeviceWebDriver webDriver ) { try { LogEntries logEntries = webDriver.manage().logs().get( "driver" ); if ( logEntries != null ) { StringBuilder logBuilder = new StringBuilder(); for ( LogEntry logEntry : logEntries ) logBuilder.append( dateFormat.format( new Date( logEntry.getTimestamp() ) ) ).append( ": " ).append( logEntry.getMessage() ).append( "\r\n" ); logBuilder.toString(); } return null; } catch ( Exception e ) { log.info( "Could not generate device logs" ); return null; } }
Example #6
Source File: BROWSERSTACKCloudActionProvider.java From xframium-java with GNU General Public License v3.0 | 6 votes |
@Override public String getLog( DeviceWebDriver webDriver ) { try { LogEntries logEntries = webDriver.manage().logs().get( LogType.BROWSER ); if ( logEntries != null ) { StringBuilder logBuilder = new StringBuilder(); for ( LogEntry logEntry : logEntries ) logBuilder.append( dateFormat.format( new Date( logEntry.getTimestamp() ) ) ).append( ": " ).append( logEntry.getMessage() ).append( "\r\n" ); logBuilder.toString(); } return null; } catch ( Exception e ) { log.info( "Could not generate device logs" ); return null; } }
Example #7
Source File: SAUCELABSCloudActionProvider.java From xframium-java with GNU General Public License v3.0 | 6 votes |
@Override public String getLog( DeviceWebDriver webDriver ) { try { LogEntries logEntries = webDriver.manage().logs().get( LogType.BROWSER ); if ( logEntries != null ) { StringBuilder logBuilder = new StringBuilder(); for ( LogEntry logEntry : logEntries ) logBuilder.append( dateFormat.format( new Date( logEntry.getTimestamp() ) ) ).append( ": " ).append( logEntry.getMessage() ).append( "\r\n" ); logBuilder.toString(); } return null; } catch ( Exception e ) { log.info( "Could not generate device logs" ); return null; } }
Example #8
Source File: SELENIUMCloudActionProvider.java From xframium-java with GNU General Public License v3.0 | 6 votes |
@Override public String getLog( DeviceWebDriver webDriver ) { try { LogEntries logEntries = webDriver.manage().logs().get( LogType.BROWSER ); if ( logEntries != null ) { StringBuilder logBuilder = new StringBuilder(); for ( LogEntry logEntry : logEntries ) logBuilder.append( dateFormat.format( new Date( logEntry.getTimestamp() ) ) ).append( ": " ).append( logEntry.getMessage() ).append( "\r\n" ); return logBuilder.toString(); } return null; } catch ( Exception e ) { log.info( "Could not generate device logs" ); return null; } }
Example #9
Source File: RemoteLogs.java From selenium with Apache License 2.0 | 6 votes |
@Override public LogEntries get(String logType) { if (LogType.PROFILER.equals(logType)) { LogEntries remoteEntries = new LogEntries(new ArrayList<>()); try { remoteEntries = getRemoteEntries(logType); } catch (WebDriverException e) { // An exception may be thrown if the WebDriver server does not recognize profiler logs. // In this case, the user should be able to see the local profiler logs. logger.log(Level.WARNING, "Remote profiler logs are not available and have been omitted.", e); } return LogCombiner.combine(remoteEntries, getLocalEntries(logType)); } if (LogType.CLIENT.equals(logType)) { return getLocalEntries(logType); } return getRemoteEntries(logType); }
Example #10
Source File: RemoteLogs.java From selenium with Apache License 2.0 | 6 votes |
private LogEntries getRemoteEntries(String logType) { Object raw = executeMethod.execute(DriverCommand.GET_LOG, ImmutableMap.of(TYPE_KEY, logType)); if (!(raw instanceof List)) { throw new UnsupportedCommandException("malformed response to remote logs command"); } @SuppressWarnings("unchecked") List<Map<String, Object>> rawList = (List<Map<String, Object>>) raw; List<LogEntry> remoteEntries = new ArrayList<>(rawList.size()); for (Map<String, Object> obj : rawList) { remoteEntries.add(new LogEntry(LogLevelMapping.toLevel((String)obj.get(LEVEL)), (Long) obj.get(TIMESTAMP), (String) obj.get(MESSAGE))); } return new LogEntries(remoteEntries); }
Example #11
Source File: JsonOutputTest.java From selenium with Apache License 2.0 | 6 votes |
@Test public void convertLogEntriesToJson() { long timestamp = new Date().getTime(); final LogEntry entry1 = new LogEntry(Level.OFF, timestamp, "entry1"); final LogEntry entry2 = new LogEntry(Level.WARNING, timestamp, "entry2"); LogEntries entries = new LogEntries(asList(entry1, entry2)); String json = convert(entries); JsonArray converted = new JsonParser().parse(json).getAsJsonArray(); JsonObject obj1 = converted.get(0).getAsJsonObject(); JsonObject obj2 = converted.get(1).getAsJsonObject(); assertThat(obj1.get("level").getAsString()).isEqualTo("OFF"); assertThat(obj1.get("timestamp").getAsLong()).isEqualTo(timestamp); assertThat(obj1.get("message").getAsString()).isEqualTo("entry1"); assertThat(obj2.get("level").getAsString()).isEqualTo("WARNING"); assertThat(obj2.get("timestamp").getAsLong()).isEqualTo(timestamp); assertThat(obj2.get("message").getAsString()).isEqualTo("entry2"); }
Example #12
Source File: RemoteLogsTest.java From selenium with Apache License 2.0 | 6 votes |
@Test public void canGetProfilerLogs() { List<LogEntry> entries = new ArrayList<>(); entries.add(new LogEntry(Level.INFO, 0, "hello")); when(localLogs.get(LogType.PROFILER)).thenReturn(new LogEntries(entries)); when( executeMethod.execute( DriverCommand.GET_LOG, ImmutableMap.of(RemoteLogs.TYPE_KEY, LogType.PROFILER))) .thenReturn(singletonList( ImmutableMap.of("level", Level.INFO.getName(), "timestamp", 1L, "message", "world"))); LogEntries logEntries = remoteLogs.get(LogType.PROFILER); List<LogEntry> allLogEntries = logEntries.getAll(); assertThat(allLogEntries).hasSize(2); assertThat(allLogEntries.get(0).getMessage()).isEqualTo("hello"); assertThat(allLogEntries.get(1).getMessage()).isEqualTo("world"); }
Example #13
Source File: JsUtility.java From Selenium-Foundation with Apache License 2.0 | 6 votes |
/** * Propagate the specified web driver exception, extracting encoded JavaScript exception if present * * @param driver A handle to the currently running Selenium test window. * @param exception web driver exception to propagate * @return nothing (this method always throws the specified exception) * @since 17.4.0 */ public static RuntimeException propagate(final WebDriver driver, final WebDriverException exception) { Throwable thrown = exception; // if exception is a WebDriverException (not a sub-class) if (JS_EXCEPTIONS.contains(exception.getClass().getName())) { // extract serialized exception object from message thrown = extractException(exception, exception.getMessage()); // if driver spec'd and no serialized exception found if ((driver != null) && (thrown.equals(exception))) { // get browser log entries LogEntries logEntries = driver.manage().logs().get(LogType.BROWSER); // for each log entry for (LogEntry logEntry : logEntries.filter(Level.WARNING)) { // extract serialized exception object from message thrown = extractException(exception, logEntry.getMessage()); // done if serialized exception found if (!thrown.equals(exception)) break; } } } // throw resolved exception as unchecked throw UncheckedThrow.throwUnchecked(thrown); }
Example #14
Source File: ConsoleTest.java From htmlunit with Apache License 2.0 | 6 votes |
/** * @throws Exception if the test fails */ @Test @BuggyWebDriver public void assertParams() throws Exception { final String html = "<html>\n" + "<body>\n" + "<script>\n" + " console.assert(false, 'the word is %s', 'foo');\n" + "</script>\n" + "</body></html>"; final WebDriver driver = loadPage2(html); final Logs logs = driver.manage().logs(); final LogEntries logEntries = logs.get(LogType.BROWSER); final List<LogEntry> logEntryList = logEntries.getAll(); assertEquals(1, logEntryList.size()); final LogEntry logEntry = logEntryList.get(0); assertTrue(logEntry.getMessage(), logEntry.getMessage() .contains("Assertion failed: the word is foo")); }
Example #15
Source File: ConsoleTest.java From htmlunit with Apache License 2.0 | 6 votes |
/** * @throws Exception if the test fails */ @Test @BuggyWebDriver public void assertObject() throws Exception { final String html = "<html>\n" + "<body>\n" + "<script>\n" + " number = 1;\n" + " console.assert(number % 2 === 0, {number: number, errorMsg: 'the # is not even'});\n" + "</script>\n" + "</body></html>"; final WebDriver driver = loadPage2(html); final Logs logs = driver.manage().logs(); final LogEntries logEntries = logs.get(LogType.BROWSER); final List<LogEntry> logEntryList = logEntries.getAll(); assertEquals(1, logEntryList.size()); final LogEntry logEntry = logEntryList.get(0); assertTrue(logEntry.getMessage(), logEntry.getMessage() .contains("Assertion failed: ({number: 1.0, errorMsg: \"the # is not even\"})")); }
Example #16
Source File: IDriverPool.java From carina with Apache License 2.0 | 6 votes |
/** * Get driver logs by type. * Android: logcat, bugreport, server, client; * iOS: syslog, crashlog, performance, server, safariConsole, safariNetwork, client * * @param driver WebDriver * @param logType String * * @return LogEntries entries */ default LogEntries getDriverLogs(WebDriver driver, String logType) { //TODO: make it async in parallel thread LogEntries logEntries = new LogEntries(Collections.emptyList()); POOL_LOGGER.debug("start getting driver logs: " + logType); try { if (driver.manage() != null) { Timer.start(ACTION_NAME.GET_LOGS); POOL_LOGGER.debug("Getting log artifact: " + logType); logEntries = driver.manage().logs().get(logType); POOL_LOGGER.debug("Got log artifact: " + logType); Timer.stop(ACTION_NAME.GET_LOGS); } else { POOL_LOGGER.error("driver.manage() is null!"); } } catch (Exception e) { POOL_LOGGER.error("Unrecorgnized error durig driver log populating!", e); } POOL_LOGGER.debug("finish getting driver logs"); return logEntries; }
Example #17
Source File: ConsoleTest.java From htmlunit with Apache License 2.0 | 6 votes |
/** * @throws Exception if the test fails */ @Test @BuggyWebDriver public void assertOnly() throws Exception { final String html = "<html>\n" + "<body>\n" + "<script>\n" + " number = 1;\n" + " console.assert(number % 2 === 0);\n" + "</script>\n" + "</body></html>"; final WebDriver driver = loadPage2(html); final Logs logs = driver.manage().logs(); final LogEntries logEntries = logs.get(LogType.BROWSER); final List<LogEntry> logEntryList = logEntries.getAll(); assertEquals(1, logEntryList.size()); final LogEntry logEntry = logEntryList.get(0); assertTrue(logEntry.getMessage(), logEntry.getMessage().contains("Assertion failed")); }
Example #18
Source File: RemoteLogsTest.java From selenium with Apache License 2.0 | 6 votes |
@Test public void canGetLocalProfilerLogsIfNoRemoteProfilerLogSupport() { List<LogEntry> entries = new ArrayList<>(); entries.add(new LogEntry(Level.INFO, 0, "hello")); when(localLogs.get(LogType.PROFILER)).thenReturn(new LogEntries(entries)); when( executeMethod.execute( DriverCommand.GET_LOG, ImmutableMap.of(RemoteLogs.TYPE_KEY, LogType.PROFILER))) .thenThrow( new WebDriverException("IGNORE THIS LOG MESSAGE AND STACKTRACE; IT IS EXPECTED.")); LogEntries logEntries = remoteLogs.get(LogType.PROFILER); List<LogEntry> allLogEntries = logEntries.getAll(); assertThat(allLogEntries).hasSize(1); assertThat(allLogEntries.get(0).getMessage()).isEqualTo("hello"); }
Example #19
Source File: Edition088_Debugging_Aids.java From appiumpro with Apache License 2.0 | 6 votes |
@Override protected void failed(Throwable e, Description desc) { // print appium logs LogEntries entries = driver.manage().logs().get("server"); System.out.println("======== APPIUM SERVER LOGS ========"); for (LogEntry entry : entries) { System.out.println(new Date(entry.getTimestamp()) + " " + entry.getMessage()); } System.out.println("================"); // print source System.out.println("======== APP SOURCE ========"); System.out.println(driver.getPageSource()); System.out.println("================"); // save screenshot String testName = desc.getMethodName().replaceAll("[^a-zA-Z0-9-_\\.]", "_"); File screenData = driver.getScreenshotAs(OutputType.FILE); try { File screenFile = new File(SCREEN_DIR + "/" + testName + ".png"); FileUtils.copyFile(screenData, screenFile); System.out.println("======== SCREENSHOT ========"); System.out.println(screenFile.getAbsolutePath()); System.out.println("================"); } catch (IOException ign) {} }
Example #20
Source File: BrowserLogCleanningListenerTests.java From vividus with Apache License 2.0 | 6 votes |
@TestFactory Stream<DynamicTest> testCleanBeforeNavigate() { WebDriver driver = mock(WebDriver.class, withSettings().extraInterfaces(HasCapabilities.class)); Consumer<Runnable> test = methodUnderTest -> { Options options = mock(Options.class); when(driver.manage()).thenReturn(options); Logs logs = mock(Logs.class); when(options.logs()).thenReturn(logs); when(logs.get(LogType.BROWSER)).thenReturn(mock(LogEntries.class)); methodUnderTest.run(); }; return Stream.of( dynamicTest("beforeNavigateBack", () -> test.accept(() -> listener.beforeNavigateBack(driver))), dynamicTest("beforeNavigateForward", () -> test.accept(() -> listener.beforeNavigateForward(driver))), dynamicTest("beforeNavigateRefresh", () -> test.accept(() -> listener.beforeNavigateRefresh(driver))), dynamicTest("beforeNavigateTo", () -> test.accept(() -> listener.beforeNavigateTo("url", driver)))); }
Example #21
Source File: ConsoleTest.java From htmlunit with Apache License 2.0 | 6 votes |
/** * @throws Exception if the test fails */ @Test @BuggyWebDriver public void assertString() throws Exception { final String html = "<html>\n" + "<body>\n" + "<script>\n" + " number = 1;\n" + " console.assert(number % 2 === 0, 'the # is not even');\n" + "</script>\n" + "</body></html>"; final WebDriver driver = loadPage2(html); final Logs logs = driver.manage().logs(); final LogEntries logEntries = logs.get(LogType.BROWSER); final List<LogEntry> logEntryList = logEntries.getAll(); assertEquals(1, logEntryList.size()); final LogEntry logEntry = logEntryList.get(0); assertTrue(logEntry.getMessage(), logEntry.getMessage().contains("Assertion failed: the # is not even")); }
Example #22
Source File: SeleniumException.java From gatf with Apache License 2.0 | 5 votes |
public SeleniumException(WebDriver d, Throwable cause, SeleniumTest test) { super(cause); Map<String, SerializableLogEntries> lg = new HashMap<String, SerializableLogEntries>(); Logs logs = d.manage().logs(); for (String s : d.manage().logs().getAvailableLogTypes()) { LogEntries logEntries = logs.get(s); if(!logEntries.getAll().isEmpty()) { lg.put(s, new SerializableLogEntries(logEntries.getAll())); } } List<LogEntry> entries = new ArrayList<LogEntry>(); entries.add(new LogEntry(Level.ALL, new Date().getTime(), cause.getMessage())); entries.add(new LogEntry(Level.ALL, new Date().getTime(), ExceptionUtils.getStackTrace(cause))); lg.put("gatf", new SerializableLogEntries(entries)); }
Example #23
Source File: PerSessionLogHandlerUnitTest.java From selenium with Apache License 2.0 | 5 votes |
@Test public void testPopulationOfSessionLog() throws IOException { PerSessionLogHandler handler = createPerSessionLogHandler(); SessionId sessionId = new SessionId("session-1"); handler.attachToCurrentThread(sessionId); LogRecord firstRecord = new LogRecord(Level.INFO, "First Log Record"); handler.publish(firstRecord); LogEntries entries = handler.getSessionLog(sessionId); assertEquals("Session log should contain one entry", 1, entries.getAll().size()); assertEquals("Session log should contain logged entry", firstRecord.getMessage(), entries.getAll().get(0).getMessage()); }
Example #24
Source File: GetLogsOfType.java From selenium with Apache License 2.0 | 5 votes |
@Override public HttpResponse execute(HttpRequest req) throws UncheckedIOException { String originalPayload = string(req); Map<String, Object> args = json.toType(originalPayload, Json.MAP_TYPE); String type = (String) args.get("type"); if (!LogType.SERVER.equals(type)) { HttpRequest upReq = new HttpRequest(POST, String.format("/session/%s/log", session.getId())); upReq.setContent(utf8String(originalPayload)); return session.execute(upReq); } LogEntries entries = null; try { entries = LoggingManager.perSessionLogHandler().getSessionLog(session.getId()); } catch (IOException e) { throw new UncheckedIOException(e); } Response response = new Response(session.getId()); response.setStatus(ErrorCodes.SUCCESS); response.setValue(entries); HttpResponse resp = new HttpResponse(); session.getDownstreamDialect().getResponseCodec().encode(() -> resp, response); return resp; }
Example #25
Source File: GetLogHandler.java From selenium with Apache License 2.0 | 5 votes |
@Override public LogEntries call() throws Exception { if (LogType.SERVER.equals(type)) { return LoggingManager.perSessionLogHandler().getSessionLog(getSessionId()); } return getDriver().manage().logs().get(type); }
Example #26
Source File: PerSessionLogHandler.java From selenium with Apache License 2.0 | 5 votes |
/** * Fetches and stores available logs from the given session and driver. * * @param sessionId The id of the session. * @param driver The driver to get the logs from. * @throws IOException If there was a problem reading from file. */ public synchronized void fetchAndStoreLogsFromDriver(SessionId sessionId, WebDriver driver) throws IOException { if (!perSessionDriverEntries.containsKey(sessionId)) { perSessionDriverEntries.put(sessionId, new HashMap<>()); } Map<String, LogEntries> typeToEntriesMap = perSessionDriverEntries.get(sessionId); if (storeLogsOnSessionQuit) { typeToEntriesMap.put(LogType.SERVER, getSessionLog(sessionId)); Set<String> logTypeSet = driver.manage().logs().getAvailableLogTypes(); for (String logType : logTypeSet) { typeToEntriesMap.put(logType, driver.manage().logs().get(logType)); } } }
Example #27
Source File: EmptyListsIT.java From flow with Apache License 2.0 | 5 votes |
@Test public void emptyListsAreProperlyHandled() { open(); WebElement template = findElement(By.id("template")); Assert.assertTrue( isPresentInShadowRoot(template, By.className("item"))); findElement(By.id("set-empty")).click(); LogEntries logs = driver.manage().logs().get("browser"); if (logs != null) { Optional<LogEntry> anyError = StreamSupport .stream(logs.spliterator(), true) .filter(entry -> entry.getLevel().intValue() > Level.INFO .intValue()) .filter(entry -> !entry.getMessage() .contains("favicon.ico")) .filter(entry -> !entry.getMessage() .contains("HTML Imports is deprecated")) .filter(entry -> !entry.getMessage() .contains("sockjs-node")) .filter(entry -> !entry.getMessage() .contains("[WDS] Disconnected!")) // Web Socket error when trying to connect to Spring Dev // Tools live-reload server. .filter(entry -> !entry.getMessage() .contains("WebSocket connection to 'ws://")) .findAny(); anyError.ifPresent(entry -> Assert.fail(entry.getMessage())); } }
Example #28
Source File: PerSessionLogHandler.java From selenium with Apache License 2.0 | 5 votes |
/** * Returns the server log for the given session id. * * @param sessionId The session id. * @return The available server log entries for the session. * @throws IOException If there was a problem reading from file. */ public synchronized LogEntries getSessionLog(SessionId sessionId) throws IOException { List<LogEntry> entries = new ArrayList<>(); for (LogRecord record : records(sessionId)) { if (record.getLevel().intValue() >= serverLogLevel.intValue()) entries.add(new LogEntry(record.getLevel(), record.getMillis(), record.getMessage())); } return new LogEntries(entries); }
Example #29
Source File: PerSessionLogHandler.java From selenium with Apache License 2.0 | 5 votes |
/** * Gets all logs for a session. * * @param sessionId The id of the session. * @return The logs for the session, ordered after log types in a session logs object. */ public synchronized SessionLogs getAllLogsForSession(SessionId sessionId) { SessionLogs sessionLogs = new SessionLogs(); if (perSessionDriverEntries.containsKey(sessionId)) { Map<String, LogEntries> typeToEntriesMap = perSessionDriverEntries.get(sessionId); for (String logType : typeToEntriesMap.keySet()) { sessionLogs.addLog(logType, typeToEntriesMap.get(logType)); } perSessionDriverEntries.remove(sessionId); } return sessionLogs; }
Example #30
Source File: RemoteLogsTest.java From selenium with Apache License 2.0 | 5 votes |
@Test public void canGetServerLogs() { when( executeMethod.execute( DriverCommand.GET_LOG, ImmutableMap.of(RemoteLogs.TYPE_KEY, LogType.SERVER))) .thenReturn(singletonList( ImmutableMap.of("level", Level.INFO.getName(), "timestamp", 0L, "message", "world"))); LogEntries logEntries = remoteLogs.get(LogType.SERVER); assertThat(logEntries.getAll()).hasSize(1); assertThat(logEntries.getAll().get(0).getMessage()).isEqualTo("world"); // Server logs should not retrieve local logs. verifyNoMoreInteractions(localLogs); }