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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

@Conditional

A
@Conditional(ClassName.class)
@ConditionalOnProperty
@ConditionalOnBean
@ConditionalOnExpression
@ConditionalOnClass
@ConditionalOnJava
@ConditionalOnWarDeployment
@ConditionalOnResource
@ConditionalOnWebApplication
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Run random port

A

Using @SpringBootTest(webEnvironment=RANDOM_PORT)

or: setting server.port=0 (work in non-test env)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

@Profile({“a”, “!b”})

A

equivalent to @Profile(“a | !b”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

HttpMessageConverter

A

Strategy interface that specifies a converter that can convert from and to HTTP requests and responses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly