ActiveProfiles class final
Sets the profiles that are active while the test class's application runs.
Use it to load test-only configuration: with ['test'], the file
application-test.properties (or .yml) is read on top of
application.properties, and beans marked @Profile(['test']) are
created. The list replaces spring.profiles.active of the config
files, so name the application's own profiles too if the tests need
them.
// The dev beans, plus the settings of application-test.yml.
@SpringBootTest()
@ActiveProfiles(['dev', 'test'])
class CheckoutTest { ... }
Spring (Java):
@SpringBootTest
@ActiveProfiles({"dev", "test"})
class CheckoutTest { ... }
Constructors
-
ActiveProfiles(List<
String> profiles) -
Activates
profilesfor the class's application.const
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited