Skip to content

Commit 6986f23

Browse files
zaeraldBuzzardo
authored andcommitted
fix: test visibility
1 parent f93d791 commit 6986f23

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

complete/src/test/java/com/example/testingweb/HttpRequestTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import static org.assertj.core.api.Assertions.assertThat;
1212

1313
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
14-
public class HttpRequestTest {
14+
class HttpRequestTest {
1515

1616
@Value(value="${local.server.port}")
1717
private int port;
@@ -20,7 +20,7 @@ public class HttpRequestTest {
2020
private TestRestTemplate restTemplate;
2121

2222
@Test
23-
public void greetingShouldReturnDefaultMessage() throws Exception {
23+
void greetingShouldReturnDefaultMessage() throws Exception {
2424
assertThat(this.restTemplate.getForObject("http://localhost:" + port + "/",
2525
String.class)).contains("Hello, World");
2626
}

complete/src/test/java/com/example/testingweb/SmokeTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
import org.springframework.boot.test.context.SpringBootTest;
99

1010
@SpringBootTest
11-
public class SmokeTest {
11+
class SmokeTest {
1212

1313
@Autowired
1414
private HomeController controller;
1515

1616
@Test
17-
public void contextLoads() throws Exception {
17+
void contextLoads() throws Exception {
1818
assertThat(controller).isNotNull();
1919
}
2020
}

complete/src/test/java/com/example/testingweb/TestingWebApplicationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515

1616
@SpringBootTest
1717
@AutoConfigureMockMvc
18-
public class TestingWebApplicationTest {
18+
class TestingWebApplicationTest {
1919

2020
@Autowired
2121
private MockMvc mockMvc;
2222

2323
@Test
24-
public void shouldReturnDefaultMessage() throws Exception {
24+
void shouldReturnDefaultMessage() throws Exception {
2525
this.mockMvc.perform(get("/")).andDo(print()).andExpect(status().isOk())
2626
.andExpect(content().string(containsString("Hello, World")));
2727
}

complete/src/test/java/com/example/testingweb/WebLayerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515
@WebMvcTest(HomeController.class)
1616
//tag::test[]
17-
public class WebLayerTest {
17+
class WebLayerTest {
1818

1919
@Autowired
2020
private MockMvc mockMvc;
2121

2222
@Test
23-
public void shouldReturnDefaultMessage() throws Exception {
23+
void shouldReturnDefaultMessage() throws Exception {
2424
this.mockMvc.perform(get("/")).andDo(print()).andExpect(status().isOk())
2525
.andExpect(content().string(containsString("Hello, World")));
2626
}

complete/src/test/java/com/example/testingweb/WebMockTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import org.springframework.test.web.servlet.MockMvc;
1616

1717
@WebMvcTest(GreetingController.class)
18-
public class WebMockTest {
18+
class WebMockTest {
1919

2020
@Autowired
2121
private MockMvc mockMvc;
@@ -24,7 +24,7 @@ public class WebMockTest {
2424
private GreetingService service;
2525

2626
@Test
27-
public void greetingShouldReturnMessageFromService() throws Exception {
27+
void greetingShouldReturnMessageFromService() throws Exception {
2828
when(service.greet()).thenReturn("Hello, Mock");
2929
this.mockMvc.perform(get("/greeting")).andDo(print()).andExpect(status().isOk())
3030
.andExpect(content().string(containsString("Hello, Mock")));

initial/src/test/java/com/example/testingweb/TestingWebApplicationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
import org.springframework.boot.test.context.SpringBootTest;
66

77
@SpringBootTest
8-
public class TestingWebApplicationTests {
8+
class TestingWebApplicationTests {
99

1010
@Test
11-
public void contextLoads() {
11+
void contextLoads() {
1212
}
1313

1414
}

0 commit comments

Comments
 (0)