PAN-11 Fixed integration tests
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@ import static org.junit.Assert.*;
|
|||||||
import static org.mockito.AdditionalMatchers.not;
|
import static org.mockito.AdditionalMatchers.not;
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
@ContextConfiguration(classes = ServiceTestConfig.class)
|
@ContextConfiguration(classes = ServicesTestConfig.class)
|
||||||
@TestPropertySource(locations = "classpath:test.properties")
|
@TestPropertySource(locations = "classpath:test.properties")
|
||||||
public class DefinitionServiceIntegrationTest {
|
public class DefinitionServiceIntegrationTest {
|
||||||
@Autowired private DefinitionService definitionService;
|
@Autowired private DefinitionService definitionService;
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
package edu.msudenver.tsp.services;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@ComponentScan
|
|
||||||
public class ServiceTestConfig {
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
@Autowired
|
|
||||||
public DefinitionService definitionService(final RestService restService) {
|
|
||||||
return new DefinitionService(restService);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -14,4 +14,10 @@ public class ServicesTestConfig {
|
|||||||
public UserService userService(final RestService restService) {
|
public UserService userService(final RestService restService) {
|
||||||
return new UserService(restService);
|
return new UserService(restService);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@Autowired
|
||||||
|
public DefinitionService definitionService(final RestService restService) {
|
||||||
|
return new DefinitionService(restService);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ public class UserServiceIntegrationTest {
|
|||||||
private UserService userService;
|
private UserService userService;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUserService(){
|
public void testCRUD() {
|
||||||
final Account testAccount = createAccount();
|
final Account testAccount = createAccount();
|
||||||
|
|
||||||
final Optional<Account> testCreatedAccount = userService.createAccount(testAccount);
|
final Optional<Account> testCreatedAccount = userService.createAccount(testAccount);
|
||||||
|
|||||||
Reference in New Issue
Block a user