Compare commits
3 Commits
master
...
fix/pmp-fc
| Author | SHA1 | Date |
|---|---|---|
|
|
8bfb77326c | |
|
|
98dd75db72 | |
|
|
74104a7413 |
|
|
@ -1,4 +1,4 @@
|
|||
package ru.touchin.push.message.provider.fcm.configurations
|
||||
package ru.touchin.push.message.provider.fcm.converters
|
||||
|
||||
import org.springframework.beans.factory.annotation.Qualifier
|
||||
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding
|
||||
|
|
@ -14,8 +14,8 @@ class DateConverter(
|
|||
private val simpleDateFormat: SimpleDateFormat
|
||||
) : Converter<String, Date> {
|
||||
|
||||
override fun convert(source: String?): Date? {
|
||||
return source?.let(simpleDateFormat::parse)
|
||||
override fun convert(source: String): Date {
|
||||
return simpleDateFormat.parse(source)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -4,16 +4,19 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect
|
|||
import com.fasterxml.jackson.annotation.PropertyAccessor
|
||||
import com.fasterxml.jackson.databind.ObjectMapper
|
||||
import com.fasterxml.jackson.databind.SerializationFeature
|
||||
import com.google.firebase.FirebaseApp
|
||||
import org.springframework.beans.factory.annotation.Qualifier
|
||||
import org.springframework.boot.SpringBootConfiguration
|
||||
import org.springframework.boot.test.context.TestConfiguration
|
||||
import org.springframework.context.ApplicationListener
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.event.ContextRefreshedEvent
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
@TestConfiguration
|
||||
@SpringBootConfiguration
|
||||
@EnablePushMessageProviderFcm
|
||||
class PushMessageProviderFcmTestApplication {
|
||||
class PushMessageProviderFcmTestApplication : ApplicationListener<ContextRefreshedEvent> {
|
||||
|
||||
@Bean
|
||||
fun objectMapper(
|
||||
|
|
@ -28,4 +31,12 @@ class PushMessageProviderFcmTestApplication {
|
|||
}
|
||||
}
|
||||
|
||||
override fun onApplicationEvent(event: ContextRefreshedEvent) {
|
||||
clearSingletonsOutsideContainer()
|
||||
}
|
||||
|
||||
private fun clearSingletonsOutsideContainer() {
|
||||
FirebaseApp.getApps().forEach(FirebaseApp::delete)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue