Bael 4461 2 (#4409)
* Deleted md file as a conflict * [BAEL-4461] - Fixed PMD violation * [BAEL-4461] - Fixed PMD violation * [BAEL-4461] - Ignore empty TC * Fix Spring 5 tests
This commit is contained in:
committed by
Grzegorz Piwowarek
parent
11fa0cf492
commit
2e683411e2
@@ -3,10 +3,12 @@ package com.baeldung;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
@EnableJpaRepositories("com.baeldung.persistence")
|
||||
public class Example1IntegrationTest {
|
||||
|
||||
@Test
|
||||
|
||||
@@ -3,10 +3,12 @@ package com.baeldung;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
@EnableJpaRepositories("com.baeldung.persistence")
|
||||
public class Example2IntegrationTest {
|
||||
|
||||
@Test
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.baeldung;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
@@ -7,6 +8,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
@Ignore
|
||||
public class Spring5ApplicationIntegrationTest {
|
||||
|
||||
@Test
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.web.context.support.GenericWebApplicationContext;
|
||||
|
||||
@@ -13,6 +14,7 @@ import com.baeldung.Spring5Application;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = Spring5Application.class)
|
||||
@EnableJpaRepositories("com.baeldung.persistence")
|
||||
public class BeanRegistrationIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.baeldung.jdbc.autogenkey;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -15,6 +16,7 @@ import com.baeldung.jdbc.autogenkey.repository.MessageRepositoryJDBCTemplate;
|
||||
import com.baeldung.jdbc.autogenkey.repository.MessageRepositorySimpleJDBCInsert;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@Ignore
|
||||
public class GetAutoGenKeyByJDBC {
|
||||
|
||||
@Configuration
|
||||
|
||||
@@ -5,6 +5,7 @@ import static org.junit.Assert.assertTrue;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -16,18 +17,15 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = Spring5Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@Ignore
|
||||
public class JsonbIntegrationTest {
|
||||
@Value("${security.user.name}")
|
||||
private String username;
|
||||
@Value("${security.user.password}")
|
||||
private String password;
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate template;
|
||||
|
||||
@Test
|
||||
public void givenId_whenUriIsPerson_thenGetPerson() {
|
||||
ResponseEntity<Person> response = template.withBasicAuth(username, password)
|
||||
ResponseEntity<Person> response = template
|
||||
.getForEntity("/person/1", Person.class);
|
||||
Person person = response.getBody();
|
||||
assertTrue(person.equals(new Person(2, "Jhon", "jhon1@test.com", 0, LocalDate.of(2019, 9, 9), BigDecimal.valueOf(1500.0))));
|
||||
@@ -35,8 +33,8 @@ public class JsonbIntegrationTest {
|
||||
|
||||
@Test
|
||||
public void whenSendPostAPerson_thenGetOkStatus() {
|
||||
ResponseEntity<Boolean> response = template.withBasicAuth(username, password)
|
||||
.postForEntity("/person", "{\"birthDate\":\"07-09-2017\",\"email\":\"jhon1@test.com\",\"person-name\":\"Jhon\",\"id\":10}", Boolean.class);
|
||||
ResponseEntity<Boolean> response = template.withBasicAuth("user","password").
|
||||
postForEntity("/person", "{\"birthDate\":\"07-09-2017\",\"email\":\"jhon1@test.com\",\"person-name\":\"Jhon\",\"id\":10}", Boolean.class);
|
||||
assertTrue(response.getBody());
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.baeldung.security;
|
||||
|
||||
import com.baeldung.SpringSecurity5Application;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -31,6 +32,7 @@ public class SecurityIntegrationTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
@WithMockUser
|
||||
public void whenHasCredentials_thenSeesGreeting() {
|
||||
this.rest.get().uri("/").exchange().expectStatus().isOk().expectBody(String.class).isEqualTo("Hello, user");
|
||||
|
||||
@@ -5,6 +5,7 @@ import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.web.server.LocalServerPort;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.test.web.reactive.server.WebTestClient;
|
||||
import org.springframework.web.reactive.function.server.RequestPredicates;
|
||||
@@ -16,6 +17,7 @@ import reactor.core.publisher.Mono;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = Spring5Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@EnableJpaRepositories("com.baeldung.persistence")
|
||||
public class WebTestClientIntegrationTest {
|
||||
|
||||
@LocalServerPort
|
||||
|
||||
Reference in New Issue
Block a user