[JAVA-963] Added parent pom to jhipster-5/bookstore-monolith and renamed tests according to conventions (*Test -> *UnitTest, *IntTest -> *IntegrationTest)
This commit is contained in:
parent
932eba6929
commit
52822b7c22
|
@ -7,6 +7,12 @@
|
|||
<version>0.0.1-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
<name>Bookstore</name>
|
||||
|
||||
<parent>
|
||||
<artifactId>jhipster-5</artifactId>
|
||||
<groupId>com.baeldung.jhipster</groupId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<repositories>
|
||||
<!-- jhipster-needle-maven-repository -->
|
||||
|
|
|
@ -37,7 +37,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
|||
*
|
||||
* @see WebConfigurer
|
||||
*/
|
||||
public class WebConfigurerTest {
|
||||
public class WebConfigurerUnitTest {
|
||||
|
||||
private WebConfigurer webConfigurer;
|
||||
|
||||
|
@ -116,7 +116,7 @@ public class WebConfigurerTest {
|
|||
props.getCors().setMaxAge(1800L);
|
||||
props.getCors().setAllowCredentials(true);
|
||||
|
||||
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
|
||||
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerUnitTestController())
|
||||
.addFilters(webConfigurer.corsFilter())
|
||||
.build();
|
||||
|
||||
|
@ -146,7 +146,7 @@ public class WebConfigurerTest {
|
|||
props.getCors().setMaxAge(1800L);
|
||||
props.getCors().setAllowCredentials(true);
|
||||
|
||||
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
|
||||
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerUnitTestController())
|
||||
.addFilters(webConfigurer.corsFilter())
|
||||
.build();
|
||||
|
||||
|
@ -161,7 +161,7 @@ public class WebConfigurerTest {
|
|||
public void testCorsFilterDeactivated() throws Exception {
|
||||
props.getCors().setAllowedOrigins(null);
|
||||
|
||||
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
|
||||
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerUnitTestController())
|
||||
.addFilters(webConfigurer.corsFilter())
|
||||
.build();
|
||||
|
||||
|
@ -176,7 +176,7 @@ public class WebConfigurerTest {
|
|||
public void testCorsFilterDeactivated2() throws Exception {
|
||||
props.getCors().setAllowedOrigins(new ArrayList<>());
|
||||
|
||||
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
|
||||
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerUnitTestController())
|
||||
.addFilters(webConfigurer.corsFilter())
|
||||
.build();
|
||||
|
|
@ -4,7 +4,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class WebConfigurerTestController {
|
||||
public class WebConfigurerUnitTestController {
|
||||
|
||||
@GetMapping("/api/test-cors")
|
||||
public void testCorsOnApiPath() {
|
|
@ -33,7 +33,7 @@ import static com.baeldung.jhipster5.repository.CustomAuditEventRepository.EVENT
|
|||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = BookstoreApp.class)
|
||||
@Transactional
|
||||
public class CustomAuditEventRepositoryIntTest {
|
||||
public class CustomAuditEventRepositoryIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
private PersistenceAuditEventRepository persistenceAuditEventRepository;
|
|
@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = BookstoreApp.class)
|
||||
@Transactional
|
||||
public class DomainUserDetailsServiceIntTest {
|
||||
public class DomainUserDetailsServiceIntegrationTest {
|
||||
|
||||
private static final String USER_ONE_LOGIN = "test-user-one";
|
||||
private static final String USER_ONE_EMAIL = "test-user-one@localhost";
|
|
@ -20,7 +20,7 @@ import java.util.Collections;
|
|||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class JWTFilterTest {
|
||||
public class JWTFilterUnitTest {
|
||||
|
||||
private TokenProvider tokenProvider;
|
||||
|
|
@ -22,7 +22,7 @@ import io.jsonwebtoken.security.Keys;
|
|||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class TokenProviderTest {
|
||||
public class TokenProviderUnitTest {
|
||||
|
||||
private final long ONE_MINUTE = 60000;
|
||||
private Key key;
|
|
@ -31,7 +31,7 @@ import static org.mockito.Mockito.*;
|
|||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = BookstoreApp.class)
|
||||
public class MailServiceIntTest {
|
||||
public class MailServiceIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
private JHipsterProperties jHipsterProperties;
|
|
@ -38,7 +38,7 @@ import static org.mockito.Mockito.when;
|
|||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = BookstoreApp.class)
|
||||
@Transactional
|
||||
public class UserServiceIntTest {
|
||||
public class UserServiceIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
private UserRepository userRepository;
|
|
@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = BookstoreApp.class)
|
||||
public class UserMapperTest {
|
||||
public class UserMapperUnitTest {
|
||||
|
||||
private static final String DEFAULT_LOGIN = "johndoe";
|
||||
|
|
@ -49,7 +49,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
|||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = BookstoreApp.class)
|
||||
public class AccountResourceIntTest {
|
||||
public class AccountResourceIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
private UserRepository userRepository;
|
|
@ -35,7 +35,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
|||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = BookstoreApp.class)
|
||||
@Transactional
|
||||
public class AuditResourceIntTest {
|
||||
public class AuditResourceIntegrationTest {
|
||||
|
||||
private static final String SAMPLE_PRINCIPAL = "SAMPLE_PRINCIPAL";
|
||||
private static final String SAMPLE_TYPE = "SAMPLE_TYPE";
|
|
@ -43,7 +43,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
|||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = BookstoreApp.class)
|
||||
public class BookResourceIntTest {
|
||||
public class BookResourceIntegrationTest {
|
||||
|
||||
private static final String DEFAULT_TITLE = "AAAAAAAAAA";
|
||||
private static final String UPDATED_TITLE = "BBBBBBBBBB";
|
|
@ -27,7 +27,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
|||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = BookstoreApp.class)
|
||||
public class LogsResourceIntTest {
|
||||
public class LogsResourceIntegrationTest {
|
||||
|
||||
private MockMvc restLogsMockMvc;
|
||||
|
|
@ -33,7 +33,7 @@ import static org.hamcrest.Matchers.not;
|
|||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = BookstoreApp.class)
|
||||
public class UserJWTControllerIntTest {
|
||||
public class UserJWTControllerIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
private TokenProvider tokenProvider;
|
|
@ -42,7 +42,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
|||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = BookstoreApp.class)
|
||||
public class UserResourceIntTest {
|
||||
public class UserResourceIntegrationTest {
|
||||
|
||||
private static final String DEFAULT_LOGIN = "johndoe";
|
||||
private static final String UPDATED_LOGIN = "jhipster";
|
|
@ -25,7 +25,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
|||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = BookstoreApp.class)
|
||||
public class ExceptionTranslatorIntTest {
|
||||
public class ExceptionTranslatorIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
private ExceptionTranslatorTestController controller;
|
Loading…
Reference in New Issue