sdeleuze
01/16/2017, 1:45 PMaaverin
01/16/2017, 2:05 PMaaverin
01/16/2017, 2:06 PMapp:
test: "test"
http:
server_timeout: 35000
client_connect_timeout: 5000
client_read_timeout: 5000
async:
threads_per_processor: 10
work_queue_capacity: 10
aaverin
01/16/2017, 2:06 PM@ConfigurationProperties(prefix = "app")
@Entity
class AppProperties {
var test: String? = null
@Valid
var http: Http? = null
@Valid
var async: Async? = null
}
class Http {
var serverTimeout: Int = 0
var clientConnectTimeout: Int = 0
var clientReadTimeout: Int = 0
}
class Async {
val threadsPerProcessor: Int = 0
val workQueueCapacity: Int = 0
}
aaverin
01/16/2017, 2:06 PMaaverin
01/16/2017, 2:06 PMnfrankel
01/16/2017, 2:48 PM@Entity
& @ConfigurationProperties
on the same class?
that’s an usage i’ve never seen
i would inject the class annotated with @ConfigurationProperties
into the one annotated with @Entity
decoupling for better testabilityaaverin
01/16/2017, 2:56 PMnfrankel
01/16/2017, 3:52 PMaaverin
01/17/2017, 10:45 AMnimtiazm
01/17/2017, 2:04 PMnimtiazm
01/17/2017, 2:04 PMsdeleuze
01/17/2017, 4:12 PMkotlin-spring
and other compiler pluginssdeleuze
01/17/2017, 4:12 PMdouglarek
01/18/2017, 3:24 AMdouglarek
01/18/2017, 3:24 AMdouglarek
01/18/2017, 3:25 AMsdeleuze
01/18/2017, 7:36 AMsdeleuze
01/18/2017, 7:37 AMHandlerFunction { }
. Also now the ServerRequest
param is explicit, that less confusing IMO.sdeleuze
01/18/2017, 7:38 AMsdeleuze
01/18/2017, 7:39 AM::findAll
instead of this@UserController::findAll
bodiam
01/21/2017, 11:24 PMsdeleuze
01/23/2017, 7:29 AMmax.
01/23/2017, 5:47 PM@Autowired
in my tests. So I have a class annotated with @Repository
and test that looks like the following
@RunWith(SpringJUnit4ClassRunner::class)
@ContextConfiguration
@ActiveProfiles("test")
class MyTest {
@Autowired lateinit var repo: MyRepository
}
With all this I get the error Could not autowire. No beans of 'MyRepository' type found
. Any ideas how to fix it without xml config files?🙂michael.barker
01/23/2017, 5:50 PMmax.
01/23/2017, 5:51 PMnfrankel
01/23/2017, 8:17 PMMyRepository
bean must come from somewhere
if you’re using standard spring, the test class must be annotated with @ContextConfiguration
and point to the configuration classyousuf.haque
01/23/2017, 11:28 PMbodiam
01/24/2017, 1:23 AMyousuf.haque
01/24/2017, 1:31 AM