From 20a3f472ac2229e54955b29ad9d9d69e8bfe6148 Mon Sep 17 00:00:00 2001 From: Tom Akehurst Date: Tue, 10 Mar 2020 12:14:39 +0000 Subject: [PATCH] Minor tweaks to OAuth2 WireMock login test --- build.gradle | 3 ++- src/test/java/mocklab/demo/OAuth2LoginTest.java | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index c0fdfed..bd2b878 100644 --- a/build.gradle +++ b/build.gradle @@ -34,7 +34,8 @@ dependencies { testCompile("org.springframework.boot:spring-boot-starter-test") testCompile("org.seleniumhq.selenium:selenium-api") testCompile 'org.seleniumhq.selenium:selenium-chrome-driver' - testCompile('com.github.tomakehurst:wiremock:2.26.3') + testCompile('com.github.tomakehurst:wiremock-jre8:2.26.3') + testCompile("junit:junit") testCompile('org.assertj:assertj-core:3.8.0') } diff --git a/src/test/java/mocklab/demo/OAuth2LoginTest.java b/src/test/java/mocklab/demo/OAuth2LoginTest.java index 3ec702f..d14f354 100644 --- a/src/test/java/mocklab/demo/OAuth2LoginTest.java +++ b/src/test/java/mocklab/demo/OAuth2LoginTest.java @@ -70,13 +70,11 @@ public void logs_in_via_wiremock_sso() throws Exception { webDriver.findElement(By.name("password")).sendKeys("pass123"); webDriver.findElement(By.id("submit")).click(); - Thread.sleep(2000); - assertThat(webDriver.getCurrentUrl()).contains("/user"); assertThat(webDriver.findElement(By.tagName("h1")).getText()).contains("Hello bwatkins@test.com!"); } static { - System.setProperty("webdriver.chrome.driver", "lib/chromedriver"); + System.setProperty("webdriver.chrome.driver", "lib/chromedriver"); // This is the OSX driver. You'll need to tweak this if you want to run on Windows or Linux. } }