Skip to content

Commit

Permalink
Made Facebook App ID optional
Browse files Browse the repository at this point in the history
  • Loading branch information
musketyr committed Apr 17, 2024
1 parent d4f0ef7 commit 8b8ff67
Showing 1 changed file with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,33 @@ import spock.lang.Specification
@CompileDynamic
class FacebookApplicationConfigurationSpec extends Specification {

FacebookApplication application

@AutoCleanup ApplicationContext context

void setup() {
context = ApplicationContext.builder(
'facebook.sdk.app.api-version': 'v16.0',
'facebook.sdk.app.id': '1234567890',
'facebook.sdk.app.secret': 'secret'
).build()
context.start()
void 'application version is converted'() {
given:
context = ApplicationContext.builder(
'facebook.sdk.app.api-version': 'v16.0',
'facebook.sdk.app.id': '1234567890',
'facebook.sdk.app.secret': 'secret'
).build()
context.start()

application = context.getBean(FacebookApplication)
FacebookApplication application = context.getBean(FacebookApplication)
FacebookClient client = application.createClient()
expect:
client instanceof DefaultFacebookClient
client.apiVersion == Version.VERSION_16_0
}

void 'application version is converted'() {
void 'app id is optional'() {
given:
context = ApplicationContext.builder(
'facebook.sdk.app.api-version': 'v16.0',
'facebook.sdk.app.secret': 'secret'
).build()
context.start()

FacebookApplication application = context.getBean(FacebookApplication)
FacebookClient client = application.createClient()
expect:
client instanceof DefaultFacebookClient
Expand Down

0 comments on commit 8b8ff67

Please sign in to comment.