-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d04b45c
commit d02fe76
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
src/test/groovy/no/fint/provider/events/testmode/TestModeConditional.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package no.fint.provider.events.testmode | ||
|
||
class TestModeConditional { | ||
|
||
static Boolean integrationTest() { | ||
def value = System.getenv('SPRING_PROFILES_ACTIVE') ?: System.getProperty('spring.profiles.active') | ||
return (value?.toLowerCase() == 'integration') | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
src/test/groovy/no/fint/provider/events/testmode/TestModeDisabledSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package no.fint.provider.events.testmode | ||
|
||
import no.fint.provider.events.testmode.adapter.TestModeAdapter | ||
import no.fint.provider.events.testmode.consumer.TestModeController | ||
import org.springframework.beans.factory.annotation.Autowired | ||
import org.springframework.boot.test.context.SpringBootTest | ||
import spock.lang.IgnoreIf | ||
import spock.lang.Specification | ||
|
||
@SpringBootTest | ||
@IgnoreIf({ TestModeConditional.integrationTest() }) | ||
class TestModeDisabledSpec extends Specification { | ||
|
||
@Autowired(required = false) | ||
private TestModeController controller | ||
|
||
@Autowired(required = false) | ||
private TestModeAdapter adapter | ||
|
||
def "Test mode components are disabled by default"() { | ||
expect: | ||
!controller | ||
!adapter | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters