Skip to content

Commit f27f132

Browse files
shubhamkumarguptaTCSShubham Gupta C
andauthored
Spring-boot version uplift to 2.7.5 (#311)
* Spring-boot-starter-parent version uplift from 2.6.3 to 2.7.5 Co-authored-by: Shubham Gupta C <shubham.c.gupta@ericsson.com>
1 parent 1f767e4 commit f27f132

File tree

11 files changed

+76
-68
lines changed

11 files changed

+76
-68
lines changed

pom.xml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
<modelVersion>4.0.0</modelVersion>
77
<groupId>com.github.ericsson</groupId>
88
<artifactId>eiffel-intelligence-frontend</artifactId>
9-
<version>3.0.3</version>
9+
<version>3.0.4</version>
1010
<packaging>war</packaging>
1111

1212
<parent>
1313
<groupId>org.springframework.boot</groupId>
1414
<artifactId>spring-boot-starter-parent</artifactId>
15-
<version>2.6.3</version>
15+
<version>2.7.5</version>
1616
<relativePath /> <!-- .. lookup parent from repository -->
1717
</parent>
1818

@@ -131,17 +131,15 @@
131131
<version>4.0.0</version>
132132
<scope>test</scope>
133133
</dependency>
134-
<!-- https://mvnrepository.com/artifact/org.mock-server/mockserver-client-java -->
135134
<dependency>
136135
<groupId>org.seleniumhq.selenium</groupId>
137-
<artifactId>selenium-server</artifactId>
138-
<version>3.141.0</version>
136+
<artifactId>selenium-java</artifactId>
139137
<scope>test</scope>
140138
</dependency>
141139
<dependency>
142140
<groupId>org.seleniumhq.selenium</groupId>
143141
<artifactId>selenium-firefox-driver</artifactId>
144-
<version>3.141.0</version>
142+
145143
<scope>test</scope>
146144
</dependency>
147145
<!-- https://mvnrepository.com/artifact/org.mock-server/mockserver-netty -->

src/functionaltest/java/com/ericsson/ei/frontend/TestRulesFunctionality.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import java.io.IOException;
1010
import java.nio.file.Files;
1111
import java.nio.file.Paths;
12+
import java.time.Duration;
1213

1314
import org.apache.http.impl.client.CloseableHttpClient;
1415
import org.junit.AfterClass;
@@ -97,7 +98,7 @@ private void verifyAggregatedObjectButton() throws IOException {
9798
private void verifyAddAndRemoveEventButton() {
9899
testRulesPage.clickAddEventButton();
99100
testRulesPage.clickRemoveEventNumber(3);
100-
assert (new WebDriverWait(driver, 10).until((webdriver) -> !testRulesPage.presenceOfEventNumber(3)));
101+
assert (new WebDriverWait(driver, Duration.ofSeconds(10)).until((webdriver) -> !testRulesPage.presenceOfEventNumber(3)));
101102
}
102103

103104
private void verifyUploadEventsFile() {
@@ -112,22 +113,22 @@ private void verifyDownloadEventsTemplateButton() throws IOException {
112113
.respond(response().withStatusCode(200).withBody(downloadEventsTemplateMockedResponse));
113114

114115
testRulesPage.clickDownloadEventsTemplate();
115-
new WebDriverWait(driver, 10).until((webdriver) -> Files.exists(Paths.get(DOWNLOADED_EVENTS_TEMPLATE_FILE_PATH)));
116+
new WebDriverWait(driver, Duration.ofSeconds(10)).until((webdriver) -> Files.exists(Paths.get(DOWNLOADED_EVENTS_TEMPLATE_FILE_PATH)));
116117
downloadedEventsTemplate = getJSONStringFromFile(DOWNLOADED_EVENTS_TEMPLATE_FILE_PATH);
117118
assertEquals(downloadEventsTemplateMockedResponse, downloadedEventsTemplate);
118119
}
119120

120121
private void verifyAddAndRemoveRuleButton() {
121122
testRulesPage.clickAddRuleButton();
122123
testRulesPage.clickRemoveRuleNumber(3);
123-
assert (new WebDriverWait(driver, 10).until((webdriver) -> !testRulesPage.presenceOfRuleNumber(3)));
124+
assert (new WebDriverWait(driver, Duration.ofSeconds(10)).until((webdriver) -> !testRulesPage.presenceOfRuleNumber(3)));
124125
}
125126

126127
private void verifyDownloadRulesButton() throws IOException {
127128
mockClient.when(request().withMethod("GET").withPath("/templates/rules"))
128129
.respond(response().withStatusCode(200).withBody(downloadedRulesTemplate));
129130
testRulesPage.clickDownloadRulesButton();
130-
new WebDriverWait(driver, 10).until((webdriver) -> Files.exists(Paths.get(DOWNLOADED_RULES_FILE_PATH)));
131+
new WebDriverWait(driver, Duration.ofSeconds(10)).until((webdriver) -> Files.exists(Paths.get(DOWNLOADED_RULES_FILE_PATH)));
131132
String downloadedRules = getJSONStringFromFile(DOWNLOADED_RULES_FILE_PATH);
132133
assertEquals(downloadedRulesTemplate, downloadedRules);
133134
}
@@ -143,7 +144,7 @@ private void verifyDownloadRulesTemplateButton() throws IOException {
143144
mockClient.when(request().withMethod("GET").withPath("/templates/rules"))
144145
.respond(response().withStatusCode(200).withBody(mockedResponse));
145146
testRulesPage.clickDownloadRulesTemplate();
146-
new WebDriverWait(driver, 10).until((webdriver) -> Files.exists(Paths.get(DOWNLOADED_RULES_TEMPLATE_FILE_PATH)));
147+
new WebDriverWait(driver, Duration.ofSeconds(10)).until((webdriver) -> Files.exists(Paths.get(DOWNLOADED_RULES_TEMPLATE_FILE_PATH)));
147148
downloadedRulesTemplate = getJSONStringFromFile(DOWNLOADED_RULES_TEMPLATE_FILE_PATH);
148149
assertEquals(mockedResponse, downloadedRulesTemplate);
149150
}

src/functionaltest/java/com/ericsson/ei/frontend/TestSubscriptionHandling.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.io.IOException;
1111
import java.nio.file.Files;
1212
import java.nio.file.Paths;
13+
import java.time.Duration;
1314

1415
import org.apache.http.impl.client.CloseableHttpClient;
1516
import org.junit.AfterClass;
@@ -185,7 +186,7 @@ private void clickAndVerifyBulkDownloadButton() throws IOException {
185186
subscriptionPage.loadPage();
186187
subscriptionPage.clickCheckAll();
187188
subscriptionPage.clickBulkDownload();
188-
new WebDriverWait(driver, 10).until(
189+
new WebDriverWait(driver, Duration.ofSeconds(10)).until(
189190
(webdriver) -> Files.exists(Paths.get(DOWNLOADED_BULK_SUBSCRIPTIONS_FILE_PATH)));
190191
String downloadedSubscriptionsTemplate = getJSONStringFromFile(
191192
DOWNLOADED_BULK_SUBSCRIPTIONS_FILE_PATH);
@@ -194,10 +195,10 @@ private void clickAndVerifyBulkDownloadButton() throws IOException {
194195
}
195196

196197
private void clickAndVerifyGetTemplateButton() throws IOException {
197-
new WebDriverWait(driver, 10).until(
198+
new WebDriverWait(driver, Duration.ofSeconds(10)).until(
198199
(webdriver) -> subscriptionPage.presenceOfClickGetTemplateButton());
199200
subscriptionPage.clickGetTemplate();
200-
new WebDriverWait(driver, 10).until(
201+
new WebDriverWait(driver, Duration.ofSeconds(10)).until(
201202
(webdriver) -> Files.exists(Paths.get(DOWNLOADED_TEMPLATE_FILE_PATH)));
202203
String subscriptionTemplate = getJSONStringFromFile(SUBSCRIPTION_TEMPLATE_FILE_PATH);
203204
String downloadedSubscriptionsTemplate = getJSONStringFromFile(
@@ -289,7 +290,7 @@ private void clickCloneSubscriptionAndVerifyFormOpen() {
289290
private void verifyViewButtonOnSubscription() {
290291
subscriptionPage.clickExpandButtonByXPath(EXPAND_BUTTON_XPATH2);
291292
subscriptionPage.clickButtonByXPath(VIEW_BUTTON_XPATH2);
292-
assert (new WebDriverWait(driver, 10).until(
293+
assert (new WebDriverWait(driver, Duration.ofSeconds(10)).until(
293294
(webdriver) -> driver.getPageSource().contains("View Subscription")));
294295
subscriptionPage.clickFormCloseBtn();
295296
}

src/functionaltest/java/com/ericsson/ei/frontend/pageobjects/IndexPage.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.ericsson.ei.frontend.pageobjects;
22

33
import java.io.IOException;
4+
import java.time.Duration;
45

56
import org.apache.http.client.ClientProtocolException;
67
import org.apache.http.impl.client.CloseableHttpClient;
@@ -41,7 +42,7 @@ public String getTitle() {
4142
}
4243

4344
public TestRulesPage clickTestRulesPage() throws IOException {
44-
new WebDriverWait(driver, TIMEOUT_TIMER).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#test-rules']")));
45+
new WebDriverWait(driver, Duration.ofSeconds(TIMEOUT_TIMER)).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#test-rules']")));
4546
WebElement testRulesBtn = driver.findElement(By.xpath("//a[@href='#test-rules']"));
4647
testRulesBtn.click();
4748
TestRulesPage testRulesPage = new TestRulesPage(mockedHttpClient, driver, baseUrl);
@@ -50,7 +51,7 @@ public TestRulesPage clickTestRulesPage() throws IOException {
5051
}
5152

5253
public SubscriptionPage clickSubscriptionPage() throws IOException {
53-
new WebDriverWait(driver, TIMEOUT_TIMER).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#subscriptions']")));
54+
new WebDriverWait(driver, Duration.ofSeconds(TIMEOUT_TIMER)).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#subscriptions']")));
5455
WebElement subscriptionBtn = driver.findElement(By.xpath("//a[@href='#subscriptions']"));
5556
subscriptionBtn.click();
5657
SubscriptionPage subscriptionPage = new SubscriptionPage(mockedHttpClient, driver, baseUrl);
@@ -64,7 +65,7 @@ public void clickReloadButton() throws IOException {
6465
}
6566

6667
public SwitchBackendPage clickSwitchBackendInstanceBtn() throws IOException {
67-
new WebDriverWait(driver, TIMEOUT_TIMER).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#switch-backend']")));
68+
new WebDriverWait(driver, Duration.ofSeconds(TIMEOUT_TIMER)).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#switch-backend']")));
6869
WebElement switchBackendBtn = driver.findElement(By.xpath("//a[@href='#switch-backend']"));
6970
switchBackendBtn.click();
7071
SwitchBackendPage switchBackendPage = new SwitchBackendPage(mockedHttpClient, driver, baseUrl);
@@ -73,13 +74,13 @@ public SwitchBackendPage clickSwitchBackendInstanceBtn() throws IOException {
7374
}
7475

7576
public void clickEiInfoBtn() {
76-
new WebDriverWait(driver, TIMEOUT_TIMER).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#ei-info']")));
77+
new WebDriverWait(driver, Duration.ofSeconds(TIMEOUT_TIMER)).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#ei-info']")));
7778
WebElement eiffelInfoBtn = driver.findElement(By.xpath("//a[@href='#ei-info']"));
7879
eiffelInfoBtn.click();
7980
}
8081

8182
public InfoPage clickInformationBtn() {
82-
new WebDriverWait(driver, TIMEOUT_TIMER).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#information']")));
83+
new WebDriverWait(driver, Duration.ofSeconds(TIMEOUT_TIMER)).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#information']")));
8384
WebElement eiInfoBtn = driver.findElement(By.xpath("//a[@href='#information']"));
8485
eiInfoBtn.click();
8586
InfoPage infoPage = new InfoPage(mockedHttpClient, driver, baseUrl);
@@ -88,7 +89,7 @@ public InfoPage clickInformationBtn() {
8889
}
8990

9091
public InfoPage clickRulesBtn() {
91-
new WebDriverWait(driver, TIMEOUT_TIMER).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#rules']")));
92+
new WebDriverWait(driver, Duration.ofSeconds(TIMEOUT_TIMER)).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#rules']")));
9293
WebElement eiInfoBtn = driver.findElement(By.xpath("//a[@href='#rules']"));
9394
eiInfoBtn.click();
9495
InfoPage infoPage = new InfoPage(mockedHttpClient, driver, baseUrl);

src/functionaltest/java/com/ericsson/ei/frontend/pageobjects/InfoPage.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.ericsson.ei.frontend.pageobjects;
22

3+
import java.time.Duration;
4+
35
import org.apache.http.impl.client.CloseableHttpClient;
46
import org.openqa.selenium.By;
57
import org.openqa.selenium.WebElement;
@@ -13,7 +15,7 @@ public InfoPage(CloseableHttpClient mockedHttpClient, FirefoxDriver driver, Stri
1315
}
1416

1517
public String getConnectedBackend() {
16-
new WebDriverWait(driver, TIMEOUT_TIMER).until(ExpectedConditions.presenceOfElementLocated(By.id("connectedBackend")));
18+
new WebDriverWait(driver, Duration.ofSeconds(TIMEOUT_TIMER)).until(ExpectedConditions.presenceOfElementLocated(By.id("connectedBackend")));
1719
WebElement connectedBackendTextBox = driver.findElement(By.id("connectedBackend"));
1820
return connectedBackendTextBox.getText();
1921
}

src/functionaltest/java/com/ericsson/ei/frontend/pageobjects/PageBaseClass.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
import static org.mockito.Mockito.when;
2323

24+
import java.time.Duration;
25+
2426
public class PageBaseClass {
2527
CloseableHttpClient mockedHttpClient;
2628
CloseableHttpResponse mockedHttpResponse;
@@ -42,7 +44,7 @@ public void refreshPage() {
4244

4345
public void waitForJQueryToLoad() {
4446
try {
45-
WebDriverWait webDriverWait = new WebDriverWait(driver, 10);
47+
WebDriverWait webDriverWait = new WebDriverWait(driver, Duration.ofSeconds(10));
4648
webDriverWait.until((ExpectedCondition<Boolean>) wd -> ((JavascriptExecutor) wd)
4749
.executeScript("return document.readyState").equals("complete"));
4850
webDriverWait.until((ExpectedCondition<Boolean>) wd -> ((JavascriptExecutor) wd)
@@ -63,7 +65,7 @@ protected CloseableHttpResponse createMockedHTTPResponse(String message, int htt
6365
}
6466

6567
public void clickAlarmButton(){
66-
new WebDriverWait(driver, TIMEOUT_TIMER).until(ExpectedConditions.elementToBeClickable(By.id("alertsLink")));
68+
new WebDriverWait(driver, Duration.ofSeconds(TIMEOUT_TIMER)).until(ExpectedConditions.elementToBeClickable(By.id("alertsLink")));
6769
WebElement alarmBtn = driver.findElement(By.id("alertsLink"));
6870
alarmBtn.click();
6971
waitForJQueryToLoad();

0 commit comments

Comments
 (0)