diff --git a/README.md b/README.md index 3c8dc58..f15887e 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ repositories { } dependencies { - implementation 'com.nexmo:nexmo-spring-boot-starter:1.1.0' + implementation 'com.nexmo:nexmo-spring-boot-starter:2.0.0' } ``` @@ -33,7 +33,7 @@ For Maven: com.nexmo nexmo-spring-boot-starter - 1.1.0 + 2.0.0 ``` @@ -132,3 +132,7 @@ Bringing in older versions of the supported Nexmo Client, may result in some unf | v1.0.0 | v4.3.0 | | v1.0.1 | v4.3.1 | | v1.1.0 | v4.4.0 | + +| Nexmo Spring Boot Starter | Vonage Java Client | +|---|---| +| v2.0.0 | v5.5.0 | diff --git a/nexmo-spring-boot-autoconfigure/pom.xml b/nexmo-spring-boot-autoconfigure/pom.xml index ff715b9..6cd6e9b 100644 --- a/nexmo-spring-boot-autoconfigure/pom.xml +++ b/nexmo-spring-boot-autoconfigure/pom.xml @@ -7,11 +7,11 @@ com.nexmo nexmo-starter - 1.1.0 + 2.0.0 nexmo-spring-boot-autoconfigure - 1.1.0 + 2.0.0 nexmo-spring-boot-autoconfigure Spring Boot Auto Configuration for Nexmo https://github.com/nexmo/nexmo-spring-boot-starter @@ -65,9 +65,9 @@ - com.nexmo + com.vonage client - ${nexmo.version} + ${vonage.version} true @@ -149,7 +149,7 @@ org.jacoco jacoco-maven-plugin - 0.8.4 + 0.8.5 diff --git a/nexmo-spring-boot-autoconfigure/src/main/kotlin/com/nexmo/starter/NexmoAutoConfiguration.kt b/nexmo-spring-boot-autoconfigure/src/main/kotlin/com/nexmo/starter/NexmoAutoConfiguration.kt index c916664..bdc4b4e 100644 --- a/nexmo-spring-boot-autoconfigure/src/main/kotlin/com/nexmo/starter/NexmoAutoConfiguration.kt +++ b/nexmo-spring-boot-autoconfigure/src/main/kotlin/com/nexmo/starter/NexmoAutoConfiguration.kt @@ -21,17 +21,17 @@ */ package com.nexmo.starter -import com.nexmo.client.NexmoClient -import com.nexmo.client.account.AccountClient -import com.nexmo.client.applications.ApplicationClient -import com.nexmo.client.conversion.ConversionClient -import com.nexmo.client.insight.InsightClient -import com.nexmo.client.numbers.NumbersClient -import com.nexmo.client.redact.RedactClient -import com.nexmo.client.sms.SmsClient -import com.nexmo.client.sns.SnsClient -import com.nexmo.client.verify.VerifyClient -import com.nexmo.client.voice.VoiceClient +import com.vonage.client.VonageClient +import com.vonage.client.account.AccountClient +import com.vonage.client.application.ApplicationClient +import com.vonage.client.conversion.ConversionClient +import com.vonage.client.insight.InsightClient +import com.vonage.client.numbers.NumbersClient +import com.vonage.client.redact.RedactClient +import com.vonage.client.sms.SmsClient +import com.vonage.client.sns.SnsClient +import com.vonage.client.verify.VerifyClient +import com.vonage.client.voice.VoiceClient import org.jetbrains.annotations.NotNull import org.springframework.boot.autoconfigure.condition.ConditionalOnClass import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean @@ -42,7 +42,7 @@ import org.springframework.context.annotation.Configuration import org.springframework.context.annotation.Lazy @Configuration -@ConditionalOnClass(NexmoClient::class) +@ConditionalOnClass(VonageClient::class) @EnableConfigurationProperties(NexmoCredentialsProperties::class) open class NexmoAutoConfiguration( private val nexmoProperties: NexmoCredentialsProperties @@ -52,12 +52,12 @@ open class NexmoAutoConfiguration( @ConditionalOnProperty(prefix = "nexmo.creds", value = ["api-key", "secret"]) @Lazy @NotNull - open fun nexmoBuilder(): NexmoClient.Builder { + open fun vonageBuilder(): VonageClient.Builder { if (nexmoProperties.privateKeyContents.isNotBlank() && nexmoProperties.privateKeyPath.isNotBlank()) { throw IllegalArgumentException("Found both private key path and private key contents. Only one option can be used at a time.") } - val builder = NexmoClient.builder() + val builder = VonageClient.builder() .apiKey(nexmoProperties.apiKey) .apiSecret(nexmoProperties.secret) @@ -85,75 +85,75 @@ open class NexmoAutoConfiguration( @ConditionalOnProperty(prefix = "nexmo.creds", value = ["api-key", "secret"]) @Lazy @NotNull - open fun nexmoClient(builder: NexmoClient.Builder): NexmoClient = builder.build() + open fun vonageClient(builder: VonageClient.Builder): VonageClient = builder.build() @Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix = "nexmo.creds", value = ["api-key", "secret"]) @Lazy @NotNull - open fun accountClient(nexmoClient: NexmoClient): AccountClient = nexmoClient.accountClient + open fun accountClient(vonageClient: VonageClient): AccountClient = vonageClient.accountClient @Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix = "nexmo.creds", value = ["api-key", "secret"]) @Lazy @NotNull - open fun applicationClient(nexmoClient: NexmoClient): ApplicationClient = nexmoClient.applicationClient + open fun applicationClient(vonageClient: VonageClient): ApplicationClient = vonageClient.applicationClient @Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix = "nexmo.creds", value = ["api-key", "secret"]) @Lazy @NotNull - open fun conversionClient(nexmoClient: NexmoClient): ConversionClient = nexmoClient.conversionClient + open fun conversionClient(vonageClient: VonageClient): ConversionClient = vonageClient.conversionClient @Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix = "nexmo.creds", value = ["api-key", "secret"]) @Lazy @NotNull - open fun insightClient(nexmoClient: NexmoClient): InsightClient = nexmoClient.insightClient + open fun insightClient(vonageClient: VonageClient): InsightClient = vonageClient.insightClient @Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix = "nexmo.creds", value = ["api-key", "secret"]) @Lazy @NotNull - open fun numbersClient(nexmoClient: NexmoClient): NumbersClient = nexmoClient.numbersClient + open fun numbersClient(vonageClient: VonageClient): NumbersClient = vonageClient.numbersClient @Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix = "nexmo.creds", value = ["api-key", "secret"]) @Lazy @NotNull - open fun redactClient(nexmoClient: NexmoClient): RedactClient = nexmoClient.redactClient + open fun redactClient(vonageClient: VonageClient): RedactClient = vonageClient.redactClient @Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix = "nexmo.creds", value = ["api-key", "secret"]) @Lazy @NotNull - open fun smsClient(nexmoClient: NexmoClient): SmsClient = nexmoClient.smsClient + open fun smsClient(vonageClient: VonageClient): SmsClient = vonageClient.smsClient @Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix = "nexmo.creds", value = ["api-key", "secret"]) @Lazy @NotNull - open fun snsClient(nexmoClient: NexmoClient): SnsClient = nexmoClient.snsClient + open fun snsClient(vonageClient: VonageClient): SnsClient = vonageClient.snsClient @Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix = "nexmo.creds", value = ["api-key", "secret"]) @Lazy @NotNull - open fun verifyClient(nexmoClient: NexmoClient): VerifyClient = nexmoClient.verifyClient + open fun verifyClient(vonageClient: VonageClient): VerifyClient = vonageClient.verifyClient @Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix = "nexmo.creds", value = ["api-key", "secret", "application-id"]) @Lazy @NotNull - open fun voiceClient(nexmoClient: NexmoClient): VoiceClient = nexmoClient.voiceClient + open fun voiceClient(vonageClient: VonageClient): VoiceClient = vonageClient.voiceClient } diff --git a/nexmo-spring-boot-autoconfigure/src/test/kotlin/com/nexmo/starter/NexmoAutoConfigurationBuilderTest.kt b/nexmo-spring-boot-autoconfigure/src/test/kotlin/com/nexmo/starter/NexmoAutoConfigurationBuilderTest.kt index 424cb21..8762d17 100644 --- a/nexmo-spring-boot-autoconfigure/src/test/kotlin/com/nexmo/starter/NexmoAutoConfigurationBuilderTest.kt +++ b/nexmo-spring-boot-autoconfigure/src/test/kotlin/com/nexmo/starter/NexmoAutoConfigurationBuilderTest.kt @@ -21,7 +21,7 @@ */ package com.nexmo.starter -import com.nexmo.client.NexmoClient +import com.vonage.client.VonageClient import org.assertj.core.api.Assertions.assertThat import org.junit.Assert.assertEquals import org.junit.Test @@ -45,9 +45,9 @@ class NexmoAutoConfigurationBuilderTest { "nexmo.creds.api-key=api-key", "nexmo.creds.secret=secret" ).run { - assertThat(it).hasSingleBean(NexmoClient.Builder::class.java) + assertThat(it).hasSingleBean(VonageClient.Builder::class.java) // Since the bean is @Lazy, it needs to be requested. - val builder = it.getBean("nexmoBuilder") + val builder = it.getBean("vonageBuilder") val apiKey = ReflectionTestUtils.getField(builder, "apiKey") as String val secret = ReflectionTestUtils.getField(builder, "apiSecret") as String @@ -63,9 +63,9 @@ class NexmoAutoConfigurationBuilderTest { "nexmo.creds.secret=secret", "nexmo.creds.application-id=app-id" ).run { - assertThat(it).hasSingleBean(NexmoClient.Builder::class.java) + assertThat(it).hasSingleBean(VonageClient.Builder::class.java) // Since the bean is @Lazy, it needs to be requested. - val builder = it.getBean("nexmoBuilder") + val builder = it.getBean("vonageBuilder") val appId = ReflectionTestUtils.getField(builder, "applicationId") as String assertEquals("app-id", appId) @@ -80,9 +80,9 @@ class NexmoAutoConfigurationBuilderTest { "nexmo.creds.private-key-path=src/test/resources/testing.key", "nexmo.creds.private-key-contents=${keyContents}" ).run { - assertThat(it).hasSingleBean(NexmoClient.Builder::class.java) + assertThat(it).hasSingleBean(VonageClient.Builder::class.java) // Since the bean is @Lazy, it needs to be requested. - it.getBean("nexmoBuilder") + it.getBean("vonageBuilder") } } @@ -93,9 +93,9 @@ class NexmoAutoConfigurationBuilderTest { "nexmo.creds.secret=secret", "nexmo.creds.private-key-contents=${keyContents}" ).run { - assertThat(it).hasSingleBean(NexmoClient.Builder::class.java) + assertThat(it).hasSingleBean(VonageClient.Builder::class.java) // Since the bean is @Lazy, it needs to be requested. - val builder = it.getBean("nexmoBuilder") + val builder = it.getBean("vonageBuilder") val builderKeyContents = ReflectionTestUtils.getField(builder, "privateKeyContents") as ByteArray assertEquals(keyContents, builderKeyContents.toString(Charset.forName("UTF-8"))) @@ -109,9 +109,9 @@ class NexmoAutoConfigurationBuilderTest { "nexmo.creds.secret=secret", "nexmo.creds.private-key-path=src/test/resources/testing.key" ).run { - assertThat(it).hasSingleBean(NexmoClient.Builder::class.java) + assertThat(it).hasSingleBean(VonageClient.Builder::class.java) // Since the bean is @Lazy, it needs to be requested. - val builder = it.getBean("nexmoBuilder") + val builder = it.getBean("vonageBuilder") val builderKeyContents = ReflectionTestUtils.getField(builder, "privateKeyContents") as ByteArray assertEquals(keyContents, builderKeyContents.toString(Charset.forName("UTF-8"))) @@ -125,9 +125,9 @@ class NexmoAutoConfigurationBuilderTest { "nexmo.creds.secret=secret", "nexmo.creds.signature=signature" ).run { - assertThat(it).hasSingleBean(NexmoClient.Builder::class.java) + assertThat(it).hasSingleBean(VonageClient.Builder::class.java) // Since the bean is @Lazy, it needs to be requested. - val builder = it.getBean("nexmoBuilder") + val builder = it.getBean("vonageBuilder") val signature = ReflectionTestUtils.getField(builder, "signatureSecret") as String assertEquals("signature", signature) diff --git a/nexmo-spring-boot-autoconfigure/src/test/kotlin/com/nexmo/starter/NexmoAutoConfigurationConditionOnMissingBeanTest.kt b/nexmo-spring-boot-autoconfigure/src/test/kotlin/com/nexmo/starter/NexmoAutoConfigurationConditionOnMissingBeanTest.kt index 5aa91da..c952b44 100644 --- a/nexmo-spring-boot-autoconfigure/src/test/kotlin/com/nexmo/starter/NexmoAutoConfigurationConditionOnMissingBeanTest.kt +++ b/nexmo-spring-boot-autoconfigure/src/test/kotlin/com/nexmo/starter/NexmoAutoConfigurationConditionOnMissingBeanTest.kt @@ -21,18 +21,18 @@ */ package com.nexmo.starter -import com.nexmo.client.HttpWrapper -import com.nexmo.client.NexmoClient -import com.nexmo.client.account.AccountClient -import com.nexmo.client.applications.ApplicationClient -import com.nexmo.client.conversion.ConversionClient -import com.nexmo.client.insight.InsightClient -import com.nexmo.client.numbers.NumbersClient -import com.nexmo.client.redact.RedactClient -import com.nexmo.client.sms.SmsClient -import com.nexmo.client.sns.SnsClient -import com.nexmo.client.verify.VerifyClient -import com.nexmo.client.voice.VoiceClient +import com.vonage.client.HttpWrapper +import com.vonage.client.VonageClient +import com.vonage.client.account.AccountClient +import com.vonage.client.application.ApplicationClient +import com.vonage.client.conversion.ConversionClient +import com.vonage.client.insight.InsightClient +import com.vonage.client.numbers.NumbersClient +import com.vonage.client.redact.RedactClient +import com.vonage.client.sms.SmsClient +import com.vonage.client.sns.SnsClient +import com.vonage.client.verify.VerifyClient +import com.vonage.client.voice.VoiceClient import org.assertj.core.api.Assertions.assertThat import org.junit.Assert.assertEquals import org.junit.Test @@ -48,12 +48,12 @@ class NexmoAutoConfigurationConditionOnMissingBeanTest { @Test fun `when user defines a builder then only that builder is in the container`() { contextRunner.withUserConfiguration( - WithNexmoClientBuilder::class.java + WithVonageClientBuilder::class.java ).withPropertyValues( "nexmo.creds.api-key=api-key", "nexmo.creds.secret=secret" ).run { - assertThat(it).hasSingleBean(NexmoClient.Builder::class.java) - assertThat(it).doesNotHaveBean("nexmoBuilder") + assertThat(it).hasSingleBean(VonageClient.Builder::class.java) + assertThat(it).doesNotHaveBean("vonageBuilder") assertThat(it).hasBean("testBuilder") } @@ -62,13 +62,13 @@ class NexmoAutoConfigurationConditionOnMissingBeanTest { @Test fun `when user defines a nexmo client then only that client is in the container`() { contextRunner.withUserConfiguration( - WithNexmoClient::class.java + WithVonageClient::class.java ).withPropertyValues( "nexmo.creds.api-key=api-key", "nexmo.creds.secret=secret" ).run { - assertThat(it).hasSingleBean(NexmoClient::class.java) - assertThat(it).doesNotHaveBean("nexmoClient") - assertThat(it).hasBean("testNexmoClient") + assertThat(it).hasSingleBean(VonageClient::class.java) + assertThat(it).doesNotHaveBean("VonageClient") + assertThat(it).hasBean("testVonageClient") } } @@ -216,11 +216,11 @@ class NexmoAutoConfigurationConditionOnMissingBeanTest { @Test fun `when user defines a builder then that builder is used to build the Nexmo Client`() { contextRunner.withUserConfiguration( - WithNexmoClientBuilderHavingCustomBaseUri::class.java + WithVonageClientBuilderHavingCustomBaseUri::class.java ).withPropertyValues( "nexmo.creds.api-key=api-key", "nexmo.creds.secret=secret" ).run { - val client = it.getBean(NexmoClient::class.java) + val client = it.getBean(VonageClient::class.java) val wrapper = ReflectionTestUtils.getField(client, "httpWrapper") as HttpWrapper assertEquals("https://example.com", wrapper.httpConfig.apiBaseUri) diff --git a/nexmo-spring-boot-autoconfigure/src/test/kotlin/com/nexmo/starter/NexmoAutoConfigurationConditionOnPropertyTest.kt b/nexmo-spring-boot-autoconfigure/src/test/kotlin/com/nexmo/starter/NexmoAutoConfigurationConditionOnPropertyTest.kt index a357e37..f32ce7e 100644 --- a/nexmo-spring-boot-autoconfigure/src/test/kotlin/com/nexmo/starter/NexmoAutoConfigurationConditionOnPropertyTest.kt +++ b/nexmo-spring-boot-autoconfigure/src/test/kotlin/com/nexmo/starter/NexmoAutoConfigurationConditionOnPropertyTest.kt @@ -21,17 +21,17 @@ */ package com.nexmo.starter -import com.nexmo.client.NexmoClient -import com.nexmo.client.account.AccountClient -import com.nexmo.client.applications.ApplicationClient -import com.nexmo.client.conversion.ConversionClient -import com.nexmo.client.insight.InsightClient -import com.nexmo.client.numbers.NumbersClient -import com.nexmo.client.redact.RedactClient -import com.nexmo.client.sms.SmsClient -import com.nexmo.client.sns.SnsClient -import com.nexmo.client.verify.VerifyClient -import com.nexmo.client.voice.VoiceClient +import com.vonage.client.VonageClient +import com.vonage.client.account.AccountClient +import com.vonage.client.application.ApplicationClient +import com.vonage.client.conversion.ConversionClient +import com.vonage.client.insight.InsightClient +import com.vonage.client.numbers.NumbersClient +import com.vonage.client.redact.RedactClient +import com.vonage.client.sms.SmsClient +import com.vonage.client.sns.SnsClient +import com.vonage.client.verify.VerifyClient +import com.vonage.client.voice.VoiceClient import org.assertj.core.api.Assertions.assertThat import org.junit.Test import org.springframework.boot.autoconfigure.AutoConfigurations @@ -48,7 +48,7 @@ class NexmoAutoConfigurationConditionOnPropertyTest { contextRunner.withPropertyValues( "nexmo.creds.secret=secret" ).run { - assertThat(it).doesNotHaveBean(NexmoClient.Builder::class.java) + assertThat(it).doesNotHaveBean(VonageClient.Builder::class.java) } } @@ -57,7 +57,7 @@ class NexmoAutoConfigurationConditionOnPropertyTest { contextRunner.withPropertyValues( "nexmo.creds.api-key=key" ).run { - assertThat(it).doesNotHaveBean(NexmoClient.Builder::class.java) + assertThat(it).doesNotHaveBean(VonageClient.Builder::class.java) } } @@ -66,8 +66,8 @@ class NexmoAutoConfigurationConditionOnPropertyTest { contextRunner.withPropertyValues( "nexmo.creds.secret=secret", "nexmo.creds.api-key=key" ).run { - assertThat(it).hasSingleBean(NexmoClient.Builder::class.java) - assertNotNull(it.getBean(NexmoClient.Builder::class.java)) + assertThat(it).hasSingleBean(VonageClient.Builder::class.java) + assertNotNull(it.getBean(VonageClient.Builder::class.java)) } } @@ -76,7 +76,7 @@ class NexmoAutoConfigurationConditionOnPropertyTest { contextRunner.withPropertyValues( "nexmo.creds.secret=secret" ).run { - assertThat(it).doesNotHaveBean(NexmoClient::class.java) + assertThat(it).doesNotHaveBean(VonageClient::class.java) } } @@ -85,7 +85,7 @@ class NexmoAutoConfigurationConditionOnPropertyTest { contextRunner.withPropertyValues( "nexmo.creds.api-key=key" ).run { - assertThat(it).doesNotHaveBean(NexmoClient::class.java) + assertThat(it).doesNotHaveBean(VonageClient::class.java) } } @@ -94,8 +94,8 @@ class NexmoAutoConfigurationConditionOnPropertyTest { contextRunner.withPropertyValues( "nexmo.creds.secret=secret", "nexmo.creds.api-key=key" ).run { - assertThat(it).hasSingleBean(NexmoClient::class.java) - assertNotNull(it.getBean(NexmoClient::class.java)) + assertThat(it).hasSingleBean(VonageClient::class.java) + assertNotNull(it.getBean(VonageClient::class.java)) } } diff --git a/nexmo-spring-boot-autoconfigure/src/test/kotlin/com/nexmo/starter/TestConfigurationClasses.kt b/nexmo-spring-boot-autoconfigure/src/test/kotlin/com/nexmo/starter/TestConfigurationClasses.kt index 6384bf0..6e66849 100644 --- a/nexmo-spring-boot-autoconfigure/src/test/kotlin/com/nexmo/starter/TestConfigurationClasses.kt +++ b/nexmo-spring-boot-autoconfigure/src/test/kotlin/com/nexmo/starter/TestConfigurationClasses.kt @@ -21,89 +21,89 @@ */ package com.nexmo.starter -import com.nexmo.client.HttpConfig -import com.nexmo.client.NexmoClient +import com.vonage.client.HttpConfig +import com.vonage.client.VonageClient import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration @Configuration -open class WithNexmoClientBuilder { +open class WithVonageClientBuilder { @Bean(name = ["testBuilder"]) - open fun builder(): NexmoClient.Builder { - return NexmoClient.builder() + open fun builder(): VonageClient.Builder { + return VonageClient.builder() } } @Configuration -open class WithNexmoClientBuilderHavingCustomBaseUri { +open class WithVonageClientBuilderHavingCustomBaseUri { @Bean(name = ["testBuilder"]) - open fun builder(): NexmoClient.Builder { - return NexmoClient.builder().httpConfig(HttpConfig.builder().baseUri("https://example.com").build()) + open fun builder(): VonageClient.Builder { + return VonageClient.builder().httpConfig(HttpConfig.builder().baseUri("https://example.com").build()) } } @Configuration -open class WithNexmoClient { - @Bean(name = ["testNexmoClient"]) - open fun client() = NexmoClient.builder().build() +open class WithVonageClient { + @Bean(name = ["testVonageClient"]) + open fun client() = VonageClient.builder().build() } @Configuration open class WithAccountClient { @Bean(name = ["testAccountClient"]) - open fun builder() = NexmoClient.builder().build().accountClient + open fun builder() = VonageClient.builder().build().accountClient } @Configuration open class WithApplicationClient { @Bean(name = ["testApplicationClient"]) - open fun builder() = NexmoClient.builder().build().applicationClient + open fun builder() = VonageClient.builder().build().applicationClient } @Configuration open class WithConversionClient { @Bean(name = ["testConversionClient"]) - open fun builder() = NexmoClient.builder().build().conversionClient + open fun builder() = VonageClient.builder().build().conversionClient } @Configuration open class WithInsightClient { @Bean(name = ["testInsightClient"]) - open fun builder() = NexmoClient.builder().build().insightClient + open fun builder() = VonageClient.builder().build().insightClient } @Configuration open class WithNumbersClient { @Bean(name = ["testNumbersClient"]) - open fun builder() = NexmoClient.builder().build().numbersClient + open fun builder() = VonageClient.builder().build().numbersClient } @Configuration open class WithRedactClient { @Bean(name = ["testRedactClient"]) - open fun builder() = NexmoClient.builder().build().redactClient + open fun builder() = VonageClient.builder().build().redactClient } @Configuration open class WithSmsClient { @Bean(name = ["testSmsClient"]) - open fun builder() = NexmoClient.builder().build().smsClient + open fun builder() = VonageClient.builder().build().smsClient } @Configuration open class WithSnsClient { @Bean(name = ["testSnsClient"]) - open fun builder() = NexmoClient.builder().build().snsClient + open fun builder() = VonageClient.builder().build().snsClient } @Configuration open class WithVerifyClient { @Bean(name = ["testVerifyClient"]) - open fun builder() = NexmoClient.builder().build().verifyClient + open fun builder() = VonageClient.builder().build().verifyClient } @Configuration open class WithVoiceClient { @Bean(name = ["testVoiceClient"]) - open fun builder() = NexmoClient.builder().build().voiceClient + open fun builder() = VonageClient.builder().build().voiceClient } \ No newline at end of file diff --git a/nexmo-spring-boot-starter/pom.xml b/nexmo-spring-boot-starter/pom.xml index b8f9b69..69b21f7 100644 --- a/nexmo-spring-boot-starter/pom.xml +++ b/nexmo-spring-boot-starter/pom.xml @@ -6,10 +6,10 @@ com.nexmo nexmo-starter - 1.1.0 + 2.0.0 nexmo-spring-boot-starter - 1.1.0 + 2.0.0 nexmo-spring-boot-starter Nexmo Spring Boot Starter https://github.com/nexmo/nexmo-spring-boot-starter @@ -44,12 +44,12 @@ com.nexmo client - ${nexmo.version} + ${vonage.version} com.nexmo nexmo-spring-boot-autoconfigure - 1.1.0 + 2.0.0 diff --git a/nexmo-spring-boot-test-application/pom.xml b/nexmo-spring-boot-test-application/pom.xml index d5abb7d..3e9a6ee 100644 --- a/nexmo-spring-boot-test-application/pom.xml +++ b/nexmo-spring-boot-test-application/pom.xml @@ -6,10 +6,10 @@ com.nexmo nexmo-starter - 1.1.0 + 2.0.0 nexmo-spring-boot-test-application - 1.1.0 + 2.0.0 nexmo-spring-boot-test-application http://maven.apache.org @@ -22,7 +22,7 @@ com.nexmo nexmo-spring-boot-starter - 1.1.0 + 2.0.0 @@ -35,6 +35,12 @@ kotlin-stdlib-jdk8 ${kotlin.version} + + com.vonage + client + 5.5.0 + compile + diff --git a/nexmo-spring-boot-test-application/src/main/kotlin/com/nexmo/starter/BalanceController.kt b/nexmo-spring-boot-test-application/src/main/kotlin/com/nexmo/starter/BalanceController.kt index 0b5539e..8a0735d 100644 --- a/nexmo-spring-boot-test-application/src/main/kotlin/com/nexmo/starter/BalanceController.kt +++ b/nexmo-spring-boot-test-application/src/main/kotlin/com/nexmo/starter/BalanceController.kt @@ -21,16 +21,16 @@ */ package com.nexmo.starter -import com.nexmo.client.NexmoClient +import com.vonage.client.VonageClient import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RestController @RestController class BalanceController( - val nexmoClient: NexmoClient + val vonageClient: VonageClient ) { @GetMapping("balance") fun get(): Double { - return nexmoClient.accountClient.balance.value + return vonageClient.accountClient.balance.value } } \ No newline at end of file diff --git a/pom.xml b/pom.xml index bf98467..f40656a 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.nexmo nexmo-starter - 1.1.0 + 2.0.0 pom nexmo-starter @@ -41,7 +41,7 @@ org.springframework.boot spring-boot-starter-parent - 2.1.4.RELEASE + 2.3.2.RELEASE @@ -137,7 +137,7 @@ 1.8 1.3.31 - 4.4.0 - 2.1.4.RELEASE + 5.5.0 + 2.3.2.RELEASE - \ No newline at end of file +