Skip to content

Commit 74da012

Browse files
author
eugenp
committed
minor formatting work
1 parent b7db6ce commit 74da012

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

‎spring-mvc-java/src/test/java/com/baeldung/htmlunit/HtmlUnitAndSpringTest.java‎

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
package com.baeldung.htmlunit;
22

3-
import java.io.IOException;
4-
53
import org.junit.Assert;
64
import org.junit.Before;
7-
import org.junit.Ignore;
85
import org.junit.Test;
96
import org.junit.runner.RunWith;
107
import org.springframework.beans.factory.annotation.Autowired;
@@ -14,7 +11,6 @@
1411
import org.springframework.test.web.servlet.htmlunit.MockMvcWebClientBuilder;
1512
import org.springframework.web.context.WebApplicationContext;
1613

17-
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
1814
import com.gargoylesoftware.htmlunit.WebClient;
1915
import com.gargoylesoftware.htmlunit.html.HtmlForm;
2016
import com.gargoylesoftware.htmlunit.html.HtmlPage;
@@ -33,8 +29,7 @@ public class HtmlUnitAndSpringTest {
3329

3430
@Before
3531
public void setup() {
36-
webClient = MockMvcWebClientBuilder
37-
.webAppContextSetup(wac).build();
32+
webClient = MockMvcWebClientBuilder.webAppContextSetup(wac).build();
3833
}
3934

4035
@Test
@@ -44,18 +39,16 @@ public void givenAMessage_whenSent_thenItShows() throws Exception {
4439

4540
String url = "http://localhost/message/showForm";
4641
page = webClient.getPage(url);
47-
42+
4843
HtmlTextInput messageText = page.getHtmlElementById("message");
4944
messageText.setValueAttribute(text);
5045

5146
HtmlForm form = page.getForms().get(0);
52-
HtmlSubmitInput submit = form.getOneHtmlElementByAttribute(
53-
"input", "type", "submit");
47+
HtmlSubmitInput submit = form.getOneHtmlElementByAttribute("input", "type", "submit");
5448
HtmlPage newPage = submit.click();
5549

56-
String receivedText = newPage.getHtmlElementById("received")
57-
.getTextContent();
50+
String receivedText = newPage.getHtmlElementById("received").getTextContent();
5851

59-
Assert.assertEquals(receivedText, text);
52+
Assert.assertEquals(receivedText, text);
6053
}
6154
}

0 commit comments

Comments
 (0)