0-Notes Flashcards
1
Q
@Enable and @Auto
A
- @EntityScan w/SpringBootApplication
- @EnableJpaRepository(basePackage=”…”) with @Configuration
- @EnableWebSecurity with @Configuration
- @EnableGlobalMethodSecurity with
- @EnableHypermediaSupport(type=HypermediaType.HAL) with @Configuration
- @EnableWebMvc with @Configuration
- @EnableAutoConfiguration
- @EnableConfigurationProperties
- @EnableTransactionManager
- @EnableAspectJAutoProxy
- @AutoConfigureMockMvc with @SpringBootTest
- @AutoConfigureTestDatabase
2
Q
@Conditional
A
@Conditional(ClassName.class) @ConditionalOnProperty @ConditionalOnBean @ConditionalOnExpression @ConditionalOnClass @ConditionalOnJava @ConditionalOnWarDeployment @ConditionalOnResource @ConditionalOnWebApplication
3
Q
Run random port
A
Using @SpringBootTest(webEnvironment=RANDOM_PORT)
or: setting server.port=0 (work in non-test env)
4
Q
A profile expression allows for more complicated profile logic to be expressed, for example “p1 & p2”
A
(a & b) | c” or “a & (b | c)
5
Q
@Profile({“a”, “!b”})
A
equivalent to @Profile(“a | !b”)
6
Q
HttpMessageConverter
A
Strategy interface that specifies a converter that can convert from and to HTTP requests and responses.