Skip to content

Commit

Permalink
SHIBUI-2024
Browse files Browse the repository at this point in the history
slight refactoring (test cleanup)
  • Loading branch information
chasegawa committed Aug 18, 2021
1 parent d941498 commit 130dd66
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.autoconfigure.domain.EntityScan
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Primary
import org.springframework.context.annotation.Profile
import org.springframework.data.jpa.repository.config.EnableJpaRepositories
import org.springframework.security.core.Authentication
Expand Down Expand Up @@ -64,7 +65,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@EnableJpaRepositories(basePackages = ["edu.internet2.tier.shibboleth.admin.ui"])
@EntityScan("edu.internet2.tier.shibboleth.admin.ui")
@DirtiesContext
@ActiveProfiles(["local"])
@ActiveProfiles(["edc-test"])
class EntityDescriptorControllerTests extends Specification {
@Autowired
EntityDescriptorRepository entityDescriptorRepository
Expand Down Expand Up @@ -796,9 +797,10 @@ class EntityDescriptorControllerTests extends Specification {
}
@org.springframework.boot.test.context.TestConfiguration
@Profile(value = "local")
@Profile(value = "edc-test")
static class LocalConfig {
@Bean
@Primary
GroupServiceForTesting groupServiceForTesting(GroupsRepository repo, OwnershipRepository ownershipRepository) {
GroupServiceForTesting result = new GroupServiceForTesting(new GroupServiceImpl().with {
it.groupRepository = repo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import org.springframework.boot.autoconfigure.domain.EntityScan
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest
import org.springframework.boot.test.context.TestConfiguration
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Primary
import org.springframework.context.annotation.Profile
import org.springframework.data.jpa.repository.config.EnableJpaRepositories
import org.springframework.test.annotation.DirtiesContext
Expand Down Expand Up @@ -129,6 +130,7 @@ class GroupServiceTests extends Specification {
@Profile("gs-test")
static class LocalConfig {
@Bean
@Primary
GroupServiceForTesting groupServiceForTesting(GroupsRepository repo, OwnershipRepository ownershipRepository) {
GroupServiceForTesting result = new GroupServiceForTesting(new GroupServiceImpl().with {
it.groupRepository = repo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest
import org.springframework.boot.test.context.TestConfiguration
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.Primary
import org.springframework.context.annotation.Profile
import org.springframework.data.jpa.repository.config.EnableJpaRepositories
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder
Expand Down Expand Up @@ -246,6 +247,7 @@ class UserServiceTests extends Specification {
@Profile("us-test")
static class LocalConfig {
@Bean
@Primary
GroupServiceForTesting groupServiceForTesting(GroupsRepository repo, OwnershipRepository ownershipRepository) {
GroupServiceForTesting result = new GroupServiceForTesting(new GroupServiceImpl().with {
it.groupRepository = repo
Expand Down

0 comments on commit 130dd66

Please sign in to comment.