cleanup work
This commit is contained in:
parent
e84137bdfc
commit
51a96d14de
|
@ -20,7 +20,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
|||
@SuppressWarnings("unused")
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = ServerLocationApp.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
public class ServerLocationAppTests {
|
||||
public class ServerLocationAppIntegrationTest {
|
||||
ConfigurableApplicationContext application2;
|
||||
ConfigurableApplicationContext application3;
|
||||
|
|
@ -7,9 +7,9 @@ import org.baeldung.config.PersistenceConfig;
|
|||
import org.baeldung.config.SecurityConfig;
|
||||
import org.baeldung.persistence.dao.UserRepository;
|
||||
import org.baeldung.persistence.model.User;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.After;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.SpringApplicationConfiguration;
|
||||
import org.springframework.security.authentication.AuthenticationProvider;
|
||||
|
@ -23,7 +23,7 @@ import org.springframework.test.context.web.WebAppConfiguration;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringApplicationConfiguration(classes = { MvcConfig.class, SecurityConfig.class, PersistenceConfig.class })
|
||||
@WebAppConfiguration
|
||||
public class CustomUserDetailsServiceTest {
|
||||
public class CustomUserDetailsServiceIntegrationTest {
|
||||
|
||||
public static final String USERNAME = "user";
|
||||
public static final String PASSWORD = "pass";
|
||||
|
@ -38,6 +38,8 @@ public class CustomUserDetailsServiceTest {
|
|||
@Autowired
|
||||
PasswordEncoder passwordEncoder;
|
||||
|
||||
//
|
||||
|
||||
@Test
|
||||
public void givenExistingUser_whenAuthenticate_thenRetrieveFromDb() {
|
||||
User user = new User();
|
||||
|
@ -64,6 +66,8 @@ public class CustomUserDetailsServiceTest {
|
|||
authenticationProvider.authenticate(auth);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
myUserRepository.removeUserByUsername(USERNAME);
|
Loading…
Reference in New Issue