This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.thecodebrews.kotlinspringvaluedemo | |
import org.springframework.beans.factory.annotation.Value | |
import org.springframework.stereotype.Component | |
import javax.annotation.PostConstruct | |
@Component | |
class StoreConfiguration( | |
@Value("\${store.no-of-customers-capacity}") val capacity: Int | |
) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.thecodebrews.kotlinspringvaluedemo | |
import org.springframework.beans.factory.annotation.Value | |
import org.springframework.stereotype.Component | |
import javax.annotation.PostConstruct | |
@Component | |
class StoreConfiguration { | |
@Value("\${store.size-in-meter-square}") | |
val size: Int = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.thecodebrews.kotlinspringvaluedemo | |
import org.springframework.beans.factory.annotation.Value | |
import org.springframework.boot.autoconfigure.SpringBootApplication | |
import org.springframework.boot.runApplication | |
import javax.annotation.PostConstruct | |
@SpringBootApplication | |
class KotlinspringvaluedemoApplication( | |
@Value("\${application.name}") private val appName: String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.thecodebrews.kotlinspringvaluedemo | |
import org.springframework.beans.factory.annotation.Value | |
import org.springframework.boot.autoconfigure.SpringBootApplication | |
import org.springframework.boot.runApplication | |
import javax.annotation.PostConstruct | |
@SpringBootApplication | |
class KotlinspringvaluedemoApplication { | |
@Value("\${store.name}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
store.name=mydemostore | |
store.address=123 Some Street, Some City, Some Country | |
store.size-in-meter-square=20 | |
store.no-of-customers-capacity=10 | |
application.name=SpringValueIsCool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.codebrews.kotlinkafkadynamodemo | |
import io.confluent.kafka.schemaregistry.client.MockSchemaRegistryClient | |
object MockSchemaRegistry { | |
val client = MockSchemaRegistryClient() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.codebrews.kotlinkafkadynamodemo | |
import io.confluent.kafka.schemaregistry.client.MockSchemaRegistryClient | |
import io.confluent.kafka.serializers.KafkaAvroDeserializer | |
class MockKafkaAvroDeserializer : KafkaAvroDeserializer(MockSchemaRegistry.client) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.codebrews.kotlinkafkadynamodemo | |
import io.confluent.kafka.schemaregistry.client.MockSchemaRegistryClient | |
import io.confluent.kafka.serializers.KafkaAvroSerializer | |
class MockKafkaAvroSerializer : KafkaAvroSerializer(MockSchemaRegistry.client) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.codebrews.kotlinkafkadynamodemo.kafka | |
import com.nhaarman.mockitokotlin2.given | |
import com.nhaarman.mockitokotlin2.timeout | |
import com.nhaarman.mockitokotlin2.verify | |
import io.codebrews.createuserrequest.CreateUserRequest | |
import io.codebrews.kotlinkafkadynamodemo.config.KafkaConfigProperties | |
import io.codebrews.kotlinkafkadynamodemo.service.CreateUserRequestHandler | |
import io.confluent.kafka.serializers.AbstractKafkaSchemaSerDeConfig | |
import org.apache.kafka.clients.producer.ProducerConfig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application: | |
dynamo: | |
customer-table-name: "demo-customer-info" | |
region: "ap-southeast-2" | |
endpoint: "http://localhost:8042" | |
kafka: | |
broker: "localhost:9092" | |
serializer: io.confluent.kafka.serializers.KafkaAvroSerializer | |
deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer | |
schema-registry-url: "http://localhost:8081" |
NewerOlder