Skip to content

Commit 4331b39

Browse files
authored
[JAVA-42436] Reduce logging of tutorials-build job (#18398)
1 parent 3409d63 commit 4331b39

File tree

6 files changed

+43
-23
lines changed

6 files changed

+43
-23
lines changed

apache-httpclient/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
<plugin>
8686
<groupId>org.apache.maven.plugins</groupId>
8787
<artifactId>maven-surefire-plugin</artifactId>
88+
<version>${maven-surefire-plugin.version}</version>
8889
<configuration>
8990
<systemPropertyVariables>
9091
<mockserver.logLevel>ERROR</mockserver.logLevel>
@@ -101,7 +102,7 @@
101102
</build>
102103

103104
<properties>
104-
<mockserver.version>5.6.1</mockserver.version>
105+
<mockserver.version>5.11.2</mockserver.version>
105106
<wiremock.version>3.9.1</wiremock.version>
106107
<!-- http client & core 5 -->
107108
<httpcore5.version>5.2.5</httpcore5.version>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mockserver.logLevel=OFF

core-java-modules/core-java-date-operations/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
</dependencies>
3434

3535
<build>
36-
<finalName>core-java-date-operations-1</finalName>
36+
<finalName>core-java-date-operations</finalName>
3737
<resources>
3838
<resource>
3939
<directory>src/main/resources</directory>

jackson-modules/jackson-core/src/test/java/com/baeldung/jackson/node/JsonNodeIteratorUnitTest.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,14 @@ public class JsonNodeIteratorUnitTest {
2121
" number: 1\n" +
2222
"- type: fish\n" +
2323
" number: 50";
24-
25-
@Test
26-
public void givenANodeTree_whenIteratingSubNodes_thenWeFindExpected() throws IOException {
27-
final JsonNode rootNode = ExampleStructure.getExampleRoot();
28-
29-
String yaml = onTest.toYaml(rootNode);
30-
System.out.println(yaml.toString());
31-
32-
assertEquals(expectedYaml, yaml);
33-
34-
}
3524

25+
@Test
26+
public void givenANodeTree_whenIteratingSubNodes_thenWeFindExpected() throws IOException {
27+
final JsonNode rootNode = ExampleStructure.getExampleRoot();
28+
29+
String yaml = onTest.toYaml(rootNode);
30+
31+
assertEquals(expectedYaml, yaml);
32+
}
3633

3734
}

persistence-modules/hibernate-queries/src/main/resources/hibernate.cfg.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<property name="hibernate.connection.username">sa</property>
1111
<property name="hibernate.connection.password"></property>
1212
<property name="hibernate.dialect">org.hibernate.dialect.H2Dialect</property>
13-
<property name="show_sql">true</property>
13+
<property name="show_sql">false</property>
1414
<property name="format_sql">true</property>
1515
<property name="hbm2ddl.auto">create-drop</property>
1616
<property name="current_session_context_class">thread</property>

spring-web-modules/spring-mvc-java/src/test/java/com/baeldung/web/controller/GreetControllerUnitTest.java

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,42 +17,63 @@ public class GreetControllerUnitTest {
1717

1818
@BeforeEach
1919
void setUp() {
20-
this.mockMvc = MockMvcBuilders.standaloneSetup(new GreetController()).build();
20+
this.mockMvc = MockMvcBuilders.standaloneSetup(new GreetController())
21+
.build();
2122
}
2223

2324
@Test
2425
public void givenHomePageURI_whenMockMVC_thenReturnsIndexJSPViewName() throws Exception {
25-
this.mockMvc.perform(get("/homePage")).andExpect(view().name("index"));
26+
this.mockMvc.perform(get("/homePage"))
27+
.andExpect(view().name("index"));
2628
}
2729

2830
@Test
2931
public void givenGreetURI_whenMockMVC_thenVerifyResponse() throws Exception {
30-
this.mockMvc.perform(get("/greet")).andExpect(status().isOk()).andExpect(content().contentType(CONTENT_TYPE)).andExpect(jsonPath("$.message").value("Hello World!!!"));
32+
this.mockMvc.perform(get("/greet"))
33+
.andExpect(status().isOk())
34+
.andExpect(content().contentType(CONTENT_TYPE))
35+
.andExpect(jsonPath("$.message").value("Hello World!!!"));
3136
}
3237

3338
@Test
3439
public void givenGreetURIWithPathVariable_whenMockMVC_thenVerifyResponse() throws Exception {
35-
this.mockMvc.perform(get("/greetWithPathVariable/John")).andExpect(status().isOk()).andExpect(content().contentType(CONTENT_TYPE)).andExpect(jsonPath("$.message").value("Hello World John!!!"));
40+
this.mockMvc.perform(get("/greetWithPathVariable/John"))
41+
.andExpect(status().isOk())
42+
.andExpect(content().contentType(CONTENT_TYPE))
43+
.andExpect(jsonPath("$.message").value("Hello World John!!!"));
3644
}
3745

3846
@Test
3947
public void givenGreetURIWithPathVariable_2_whenMockMVC_thenVerifyResponse() throws Exception {
40-
this.mockMvc.perform(get("/greetWithPathVariable/{name}", "Doe")).andExpect(status().isOk()).andExpect(content().contentType(CONTENT_TYPE)).andExpect(jsonPath("$.message").value("Hello World Doe!!!"));
48+
this.mockMvc.perform(get("/greetWithPathVariable/{name}", "Doe"))
49+
.andExpect(status().isOk())
50+
.andExpect(content().contentType(CONTENT_TYPE))
51+
.andExpect(jsonPath("$.message").value("Hello World Doe!!!"));
4152
}
4253

4354
@Test
4455
public void givenGreetURIWithQueryParameter_whenMockMVC_thenVerifyResponse() throws Exception {
45-
this.mockMvc.perform(get("/greetWithQueryVariable").param("name", "John Doe")).andDo(print()).andExpect(status().isOk()).andExpect(content().contentType(CONTENT_TYPE)).andExpect(jsonPath("$.message").value("Hello World John Doe!!!"));
56+
this.mockMvc.perform(get("/greetWithQueryVariable").param("name", "John Doe"))
57+
.andExpect(status().isOk())
58+
.andExpect(content().contentType(CONTENT_TYPE))
59+
.andExpect(jsonPath("$.message").value("Hello World John Doe!!!"));
4660
}
4761

4862
@Test
4963
public void givenGreetURIWithPost_whenMockMVC_thenVerifyResponse() throws Exception {
50-
this.mockMvc.perform(post("/greetWithPost")).andDo(print()).andExpect(status().isOk()).andExpect(content().contentType(CONTENT_TYPE)).andExpect(jsonPath("$.message").value("Hello World!!!"));
64+
this.mockMvc.perform(post("/greetWithPost"))
65+
.andExpect(status().isOk())
66+
.andExpect(content().contentType(CONTENT_TYPE))
67+
.andExpect(jsonPath("$.message").value("Hello World!!!"));
5168
}
5269

5370
@Test
5471
public void givenGreetURIWithPostAndFormData_whenMockMVC_thenVerifyResponse() throws Exception {
55-
this.mockMvc.perform(post("/greetWithPostAndFormData").param("id", "1").param("name", "John Doe")).andDo(print()).andExpect(status().isOk()).andExpect(content().contentType(CONTENT_TYPE))
56-
.andExpect(jsonPath("$.message").value("Hello World John Doe!!!")).andExpect(jsonPath("$.id").value(1));
72+
this.mockMvc.perform(post("/greetWithPostAndFormData").param("id", "1")
73+
.param("name", "John Doe"))
74+
.andExpect(status().isOk())
75+
.andExpect(content().contentType(CONTENT_TYPE))
76+
.andExpect(jsonPath("$.message").value("Hello World John Doe!!!"))
77+
.andExpect(jsonPath("$.id").value(1));
5778
}
5879
}

0 commit comments

Comments
 (0)