{"id":52580,"date":"2016-02-18T07:00:08","date_gmt":"2016-02-18T05:00:08","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=52580"},"modified":"2016-02-17T13:59:25","modified_gmt":"2016-02-17T11:59:25","slug":"creating-custom-springboot-starter-twitter4j","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html","title":{"rendered":"Creating Custom SpringBoot Starter for Twitter4j"},"content":{"rendered":"<p><b>SpringBoot <\/b>provides lot of starter modules to get up and running quickly. SpringBoot\u2019s auto-configure mechanism takes care of configuring SpringBeans on our behalf based on various criteria.<\/p>\n<p>In addition to the springboot starters that comes out-of-the-box provided by Core Spring Team, we can also create our own starter modules.<\/p>\n<p>In this post we will look into how to create a custom SpringBoot starter. To demonstrate it we are going to create <b>twitter4j-spring-boot-starter<\/b> which will auto-configure Twitter4J beans.<\/p>\n<p>To accomplish this, we are going to create:<\/p>\n<ol>\n<li>\u00a0<b>twitter4j-spring-boot-autoconfigure<\/b> module which contains Twitter4J AutoConfiguration bean definitions<\/li>\n<li><b>twitter4j-spring-boot-starter<\/b> module which pulls in <b>twitter4j-spring-boot-autoconfigure<\/b> and <b>twitter4j-core<\/b> dependencies<\/li>\n<li>Sample application which uses <b>twitter4j-spring-boot-starter<\/b><\/li>\n<\/ol>\n<h2>Create Parent Module spring-boot-starter-twitter4j<\/h2>\n<p>First we are going to create a parent pom type module to define dependency versions and sub-modules.<\/p>\n<pre class=\" brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\"\r\n    xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n    xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0\r\n                        http:\/\/maven.apache.org\/maven-v4_0_0.xsd\"&gt;\r\n    &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n\r\n    &lt;groupId&gt;com.sivalabs&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;spring-boot-starter-twitter4j&lt;\/artifactId&gt;\r\n    &lt;packaging&gt;pom&lt;\/packaging&gt;\r\n    &lt;version&gt;1.0-SNAPSHOT&lt;\/version&gt;\r\n    &lt;name&gt;spring-boot-starter-twitter4j&lt;\/name&gt;\r\n\r\n    &lt;properties&gt;\r\n        &lt;project.build.sourceEncoding&gt;UTF-8&lt;\/project.build.sourceEncoding&gt;\r\n        &lt;twitter4j.version&gt;4.0.3&lt;\/twitter4j.version&gt;\r\n        &lt;spring-boot.version&gt;1.3.2.RELEASE&lt;\/spring-boot.version&gt;\r\n    &lt;\/properties&gt;\r\n\r\n    &lt;modules&gt;\r\n        &lt;module&gt;twitter4j-spring-boot-autoconfigure&lt;\/module&gt;\r\n        &lt;module&gt;twitter4j-spring-boot-starter&lt;\/module&gt;\r\n        &lt;module&gt;twitter4j-spring-boot-sample&lt;\/module&gt;\r\n    &lt;\/modules&gt;\r\n\r\n    &lt;dependencyManagement&gt;\r\n        &lt;dependencies&gt;\r\n            &lt;dependency&gt;\r\n                &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n                &lt;artifactId&gt;spring-boot-dependencies&lt;\/artifactId&gt;\r\n                &lt;version&gt;${spring-boot.version}&lt;\/version&gt;\r\n                &lt;type&gt;pom&lt;\/type&gt;\r\n                &lt;scope&gt;import&lt;\/scope&gt;\r\n            &lt;\/dependency&gt;\r\n\r\n            &lt;dependency&gt;\r\n                &lt;groupId&gt;org.twitter4j&lt;\/groupId&gt;\r\n                &lt;artifactId&gt;twitter4j-core&lt;\/artifactId&gt;\r\n                &lt;version&gt;${twitter4j.version}&lt;\/version&gt;\r\n            &lt;\/dependency&gt;\r\n        &lt;\/dependencies&gt;\r\n    &lt;\/dependencyManagement&gt;\r\n\r\n&lt;\/project&gt;<\/pre>\n<p>In this <b>pom.xml<\/b> we are defining the SpringBoot and Twitter4j versions in section so that we don\u2019t need to specify versions all over the places.<\/p>\n<p>Create twitter4j-spring-boot-autoconfigure module<\/p>\n<p>Create a child module with name <b>twitter4j-spring-boot-autoconfigure<\/b> in our parent maven module <b>spring-boot-starter-twitter4j<\/b>.<\/p>\n<p>Add the maven dependencies such as spring-boot, <b>spring-boot-autoconfigure<\/b>, <b>twitter4j-core<\/b> and <b>junit <\/b>as follows:<\/p>\n<pre class=\" brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\" \r\n    xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n    xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0\r\n               http:\/\/maven.apache.org\/maven-v4_0_0.xsd\"&gt;\r\n    &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n    &lt;groupId&gt;com.sivalabs&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;twitter4j-spring-boot-autoconfigure&lt;\/artifactId&gt;\r\n    &lt;packaging&gt;jar&lt;\/packaging&gt;\r\n    &lt;version&gt;1.0-SNAPSHOT&lt;\/version&gt;\r\n\r\n    &lt;parent&gt;\r\n        &lt;groupId&gt;com.sivalabs&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;spring-boot-starter-twitter4j&lt;\/artifactId&gt;\r\n        &lt;version&gt;1.0-SNAPSHOT&lt;\/version&gt;\r\n    &lt;\/parent&gt;\r\n\r\n    &lt;properties&gt;\r\n        &lt;project.build.sourceEncoding&gt;UTF-8&lt;\/project.build.sourceEncoding&gt;\r\n    &lt;\/properties&gt;\r\n\r\n    &lt;dependencies&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;spring-boot&lt;\/artifactId&gt;\r\n        &lt;\/dependency&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;spring-boot-autoconfigure&lt;\/artifactId&gt;\r\n        &lt;\/dependency&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;spring-boot-configuration-processor&lt;\/artifactId&gt;\r\n            &lt;optional&gt;true&lt;\/optional&gt;\r\n        &lt;\/dependency&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;junit&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;junit&lt;\/artifactId&gt;\r\n            &lt;scope&gt;test&lt;\/scope&gt;\r\n        &lt;\/dependency&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;org.twitter4j&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;twitter4j-core&lt;\/artifactId&gt;\r\n            &lt;optional&gt;true&lt;\/optional&gt;\r\n        &lt;\/dependency&gt;\r\n    &lt;\/dependencies&gt;\r\n&lt;\/project&gt;<\/pre>\n<p>Note that we have specified <b>twitter4j-core<\/b> as<b> optional <\/b>dependency because <b>twitter4j-core<\/b> should be added to the project only when <b>twitter4j-spring-boot-starter<\/b> is added to the project.<\/p>\n<h2>Create Twitter4jProperties to hold the Twitter4J config parameters<\/h2>\n<p>Create <b>Twitter4jProperties.java <\/b>to hold the Twitter4J OAuth config parameters.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\" brush:java\">package com.sivalabs.spring.boot.autoconfigure;\r\n\r\nimport org.springframework.boot.context.properties.ConfigurationProperties;\r\nimport org.springframework.boot.context.properties.NestedConfigurationProperty;\r\n\r\n@ConfigurationProperties(prefix= Twitter4jProperties.TWITTER4J_PREFIX)\r\npublic class Twitter4jProperties {\r\n\r\n    public static final String TWITTER4J_PREFIX = \"twitter4j\";\r\n\r\n    private Boolean debug = false;\r\n\r\n    @NestedConfigurationProperty\r\n    private OAuth oauth = new OAuth();\r\n\r\n    public Boolean getDebug() {\r\n        return debug;\r\n    }\r\n\r\n    public void setDebug(Boolean debug) {\r\n        this.debug = debug;\r\n    }\r\n\r\n    public OAuth getOauth() {\r\n        return oauth;\r\n    }\r\n\r\n    public void setOauth(OAuth oauth) {\r\n        this.oauth = oauth;\r\n    }\r\n\r\n    public static class OAuth {\r\n\r\n        private String consumerKey;\r\n        private String consumerSecret;\r\n        private String accessToken;\r\n        private String accessTokenSecret;\r\n\r\n        public String getConsumerKey() {\r\n            return consumerKey;\r\n        }\r\n        public void setConsumerKey(String consumerKey) {\r\n            this.consumerKey = consumerKey;\r\n        }\r\n        public String getConsumerSecret() {\r\n            return consumerSecret;\r\n        }\r\n        public void setConsumerSecret(String consumerSecret) {\r\n            this.consumerSecret = consumerSecret;\r\n        }\r\n        public String getAccessToken() {\r\n            return accessToken;\r\n        }\r\n        public void setAccessToken(String accessToken) {\r\n            this.accessToken = accessToken;\r\n        }\r\n        public String getAccessTokenSecret() {\r\n            return accessTokenSecret;\r\n        }\r\n        public void setAccessTokenSecret(String accessTokenSecret) {\r\n            this.accessTokenSecret = accessTokenSecret;\r\n        }\r\n    }\r\n}<\/pre>\n<p>With this configuration object we can configure the twitter4j properties in <b>application.properties<\/b> as follows:<\/p>\n<pre class=\" brush:java\">twitter4j.debug=true\r\ntwitter4j.oauth.consumer-key=your-consumer-key-here\r\ntwitter4j.oauth.consumer-secret=your-consumer-secret-here\r\ntwitter4j.oauth.access-token=your-access-token-here\r\ntwitter4j.oauth.access-token-secret=your-access-token-secret-here<\/pre>\n<h2>Create Twitter4jAutoConfiguration to auto-configure Twitter4J<\/h2>\n<p>Here comes the key part of our starter.<\/p>\n<p><b>Twitter4jAutoConfiguration <\/b>configuration class contains the bean definitions that will be automatically configured based on some criteria.<\/p>\n<p>What is that criteria?<\/p>\n<ul>\n<li>If <b>twitter4j.TwitterFactory<\/b>.class is on classpath<\/li>\n<li>If <b>TwitterFactory <\/b>bean is not already defined explicitly<\/li>\n<\/ul>\n<p>So, the <b>Twitter4jAutoConfiguration <\/b>goes like this.<\/p>\n<pre class=\" brush:java\">package com.sivalabs.spring.boot.autoconfigure;\r\n\r\nimport org.apache.commons.logging.Log;\r\nimport org.apache.commons.logging.LogFactory;\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.boot.autoconfigure.condition.ConditionalOnClass;\r\nimport org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;\r\nimport org.springframework.boot.context.properties.EnableConfigurationProperties;\r\nimport org.springframework.context.annotation.Bean;\r\nimport org.springframework.context.annotation.Configuration;\r\n\r\nimport twitter4j.Twitter;\r\nimport twitter4j.TwitterFactory;\r\nimport twitter4j.conf.ConfigurationBuilder;\r\n\r\n@Configuration\r\n@ConditionalOnClass({ TwitterFactory.class, Twitter.class })\r\n@EnableConfigurationProperties(Twitter4jProperties.class)\r\npublic class Twitter4jAutoConfiguration {\r\n\r\n    private static Log log = LogFactory.getLog(Twitter4jAutoConfiguration.class);\r\n\r\n    @Autowired\r\n    private Twitter4jProperties properties;\r\n\r\n    @Bean\r\n    @ConditionalOnMissingBean\r\n    public TwitterFactory twitterFactory(){\r\n\r\n        if (this.properties.getOauth().getConsumerKey() == null\r\n            || this.properties.getOauth().getConsumerSecret() == null\r\n            || this.properties.getOauth().getAccessToken() == null\r\n            || this.properties.getOauth().getAccessTokenSecret() == null)\r\n        {\r\n            String msg = \"Twitter4j properties not configured properly.\" + \r\n                         \" Please check twitter4j.* properties settings in configuration file.\";\r\n            log.error(msg);\r\n            throw new RuntimeException(msg);\r\n        }\r\n\r\n        ConfigurationBuilder cb = new ConfigurationBuilder();\r\n        cb.setDebugEnabled(properties.getDebug())\r\n          .setOAuthConsumerKey(properties.getOauth().getConsumerKey())\r\n          .setOAuthConsumerSecret(properties.getOauth().getConsumerSecret())\r\n          .setOAuthAccessToken(properties.getOauth().getAccessToken())\r\n          .setOAuthAccessTokenSecret(properties.getOauth().getAccessTokenSecret());\r\n        TwitterFactory tf = new TwitterFactory(cb.build());\r\n        return tf;\r\n    }\r\n\r\n    @Bean\r\n    @ConditionalOnMissingBean\r\n    public Twitter twitter(TwitterFactory twitterFactory){\r\n        return twitterFactory.getInstance();\r\n    }\r\n\r\n}<\/pre>\n<p>We have used <b>@ConditionalOnClass({ TwitterFactory.class, Twitter.class })<\/b> to specify that this auto configuration should take place only when <b>TwitterFactory.class, Twitter.class <\/b>classes are present.<\/p>\n<p>We have also used <b>@ConditionalOnMissingBean<\/b> on bean definition methods to specify consider this bean definition only if <b>TwitterFactory<\/b>\/<b>Twitter <\/b>beans are not already defined explicitly.<\/p>\n<p>Also note that we have annotated with <b>@EnableConfigurationProperties(Twitter4jProperties.class)<\/b> to enable support for ConfigurationProperties and injected <b>Twitter4jProperties <\/b>bean.<\/p>\n<p>Now we need to configure our custom <b>Twitter4jAutoConfiguration <\/b>in <b>src\/main\/resources\/META-INF\/spring.factories<\/b> file as follows: <\/p>\n<p><b>org.springframework.boot.autoconfigure.EnableAutoConfiguration=<br \/>\ncom.sivalabs.spring.boot.autoconfigure.Twitter4jAutoConfiguration<\/b><\/p>\n<h2>Create twitter4j-spring-boot-starter module<\/h2>\n<p>Create a child module with name twitter4j-spring-boot-starter in our parent maven module spring-boot-starter-twitter4j.<\/p>\n<pre class=\" brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\"\r\n    xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n    xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0\r\n                        http:\/\/maven.apache.org\/maven-v4_0_0.xsd\"&gt;\r\n    &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n    &lt;groupId&gt;com.sivalabs&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;twitter4j-spring-boot-starter&lt;\/artifactId&gt;\r\n    &lt;packaging&gt;jar&lt;\/packaging&gt;\r\n    &lt;version&gt;1.0-SNAPSHOT&lt;\/version&gt;\r\n\r\n    &lt;parent&gt;\r\n        &lt;groupId&gt;com.sivalabs&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;spring-boot-starter-twitter4j&lt;\/artifactId&gt;\r\n        &lt;version&gt;1.0-SNAPSHOT&lt;\/version&gt;\r\n    &lt;\/parent&gt;\r\n\r\n    &lt;properties&gt;\r\n        &lt;project.build.sourceEncoding&gt;UTF-8&lt;\/project.build.sourceEncoding&gt;\r\n    &lt;\/properties&gt;\r\n\r\n\r\n    &lt;dependencies&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;spring-boot-starter&lt;\/artifactId&gt;\r\n        &lt;\/dependency&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;com.sivalabs&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;twitter4j-spring-boot-autoconfigure&lt;\/artifactId&gt;\r\n            &lt;version&gt;${project.version}&lt;\/version&gt;\r\n        &lt;\/dependency&gt;\r\n\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;org.twitter4j&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;twitter4j-core&lt;\/artifactId&gt;\r\n        &lt;\/dependency&gt;\r\n\r\n    &lt;\/dependencies&gt;\r\n\r\n&lt;\/project&gt;<\/pre>\n<p>Note that in this maven module we are actually pulling in <b>twitter4j-core<\/b> dependency.<\/p>\n<p>We don\u2019t need to add any code in this module, but optionally we can specify what are the dependencies we are going to provide through this starter in <b>src\/main\/resources\/META-INF\/spring.provides<\/b> file as follows:<\/p>\n<p><b>provides: twitter4j-core\u00a0<\/b><\/p>\n<p>That\u2019s all for our starter.<\/p>\n<p>Let us create a sample using our brand new starter <b>twitter4j-spring-boot-starter<\/b>.<\/p>\n<h2>Create twitter4j-spring-boot-sample sample application<\/h2>\n<p>Let us create a simple SpringBoot application and add our <b>twitter4j-spring-boot-starter<\/b> dependency.<\/p>\n<pre class=\" brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\"\r\n    xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n    xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0\r\n                        http:\/\/maven.apache.org\/maven-v4_0_0.xsd\"&gt;\r\n    &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n    &lt;groupId&gt;com.sivalabs&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;twitter4j-spring-boot-sample&lt;\/artifactId&gt;\r\n    &lt;packaging&gt;jar&lt;\/packaging&gt;\r\n    &lt;version&gt;1.0-SNAPSHOT&lt;\/version&gt;\r\n\r\n    &lt;parent&gt;\r\n        &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;spring-boot-starter-parent&lt;\/artifactId&gt;\r\n        &lt;version&gt;1.3.2.RELEASE&lt;\/version&gt;\r\n    &lt;\/parent&gt;\r\n\r\n    &lt;properties&gt;\r\n        &lt;project.build.sourceEncoding&gt;UTF-8&lt;\/project.build.sourceEncoding&gt;\r\n        &lt;java.version&gt;1.8&lt;\/java.version&gt;\r\n    &lt;\/properties&gt;\r\n\r\n    &lt;build&gt;\r\n        &lt;plugins&gt;\r\n            &lt;plugin&gt;\r\n                &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n                &lt;artifactId&gt;spring-boot-maven-plugin&lt;\/artifactId&gt;\r\n            &lt;\/plugin&gt;\r\n        &lt;\/plugins&gt;\r\n    &lt;\/build&gt;\r\n\r\n    &lt;dependencies&gt;\r\n\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;com.sivalabs&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;twitter4j-spring-boot-starter&lt;\/artifactId&gt;\r\n            &lt;version&gt;1.0-SNAPSHOT&lt;\/version&gt;\r\n        &lt;\/dependency&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;spring-boot-starter-test&lt;\/artifactId&gt;\r\n            &lt;scope&gt;test&lt;\/scope&gt;\r\n        &lt;\/dependency&gt;\r\n    &lt;\/dependencies&gt;\r\n\r\n&lt;\/project&gt;<\/pre>\n<p>Create the entry-point class <b>SpringbootTwitter4jDemoApplication <\/b>as follows:<\/p>\n<pre class=\" brush:java\">package com.sivalabs.demo;\r\n\r\nimport org.springframework.boot.SpringApplication;\r\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\r\n\r\n@SpringBootApplication\r\npublic class SpringbootTwitter4jDemoApplication {\r\n\r\n    public static void main(String[] args) {\r\n        SpringApplication.run(SpringbootTwitter4jDemoApplication.class, args);\r\n    }\r\n}<\/pre>\n<p>Create <b>TweetService <\/b>as follows:<\/p>\n<pre class=\" brush:java\">package com.sivalabs.demo;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.stereotype.Service;\r\n\r\nimport twitter4j.ResponseList;\r\nimport twitter4j.Status;\r\nimport twitter4j.Twitter;\r\nimport twitter4j.TwitterException;\r\n\r\n@Service\r\npublic class TweetService {\r\n\r\n    @Autowired\r\n    private Twitter twitter;\r\n\r\n    public List&lt;String&gt; getLatestTweets(){\r\n        List&lt;String&gt; tweets = new ArrayList&lt;&gt;();\r\n        try {\r\n            ResponseList&lt;Status&gt; homeTimeline = twitter.getHomeTimeline();\r\n            for (Status status : homeTimeline) {\r\n                tweets.add(status.getText());\r\n            }\r\n        } catch (TwitterException e) {\r\n            throw new RuntimeException(e);\r\n        }\r\n        return tweets;\r\n    }\r\n}<\/pre>\n<p>Now create a Test to verify our Twitter4j AutoConfigutation.<\/p>\n<p>Before that make sure you have set your twitter4j oauth configuration parameter to your actual values. You can get them from <b>https:\/\/apps.twitter.com\/<\/b><\/p>\n<pre class=\" brush:java\">package com.sivalabs.demo;\r\n\r\nimport java.util.List;\r\n\r\nimport org.junit.Test;\r\nimport org.junit.runner.RunWith;\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.boot.test.SpringApplicationConfiguration;\r\nimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;\r\n\r\nimport twitter4j.TwitterException;\r\n\r\n@RunWith(SpringJUnit4ClassRunner.class)\r\n@SpringApplicationConfiguration(SpringbootTwitter4jDemoApplication.class)\r\npublic class SpringbootTwitter4jDemoApplicationTest  {\r\n\r\n\r\n    @Autowired\r\n    private TweetService tweetService;\r\n\r\n    @Test\r\n    public void testGetTweets() throws TwitterException {\r\n        List&lt;String&gt; tweets = tweetService.getLatestTweets();\r\n        for (String tweet : tweets) {\r\n            System.err.println(tweet);\r\n        }\r\n    }\r\n\r\n}<\/pre>\n<p>Now you should be able to see the latest tweets on your console output.<\/p>\n<ul>\n<li>You can find the code on GitHub: <b><a href=\"https:\/\/github.com\/sivaprasadreddy\/twitter4j-spring-boot-starter\">https:\/\/github.com\/sivaprasadreddy\/twitter4j-spring-boot-starter<\/a><\/b><\/li>\n<\/ul>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/www.sivalabs.in\/2016\/02\/creating-custom-springboot-starter-for.html\">Creating Custom SpringBoot Starter for Twitter4j<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/join-us\/jcg\/\">JCG partner<\/a> Siva Reddy at the <a href=\"http:\/\/www.sivalabs.in\/\">My Experiments on Technology<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>SpringBoot provides lot of starter modules to get up and running quickly. SpringBoot\u2019s auto-configure mechanism takes care of configuring SpringBeans on our behalf based on various criteria. In addition to the springboot starters that comes out-of-the-box provided by Core Spring Team, we can also create our own starter modules. In this post we will look &hellip;<\/p>\n","protected":false},"author":15,"featured_media":240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[30,304],"class_list":["post-52580","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-spring","tag-twitter4j"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Creating Custom SpringBoot Starter for Twitter4j - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"SpringBoot provides lot of starter modules to get up and running quickly. SpringBoot\u2019s auto-configure mechanism takes care of configuring SpringBeans on\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating Custom SpringBoot Starter for Twitter4j - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"SpringBoot provides lot of starter modules to get up and running quickly. SpringBoot\u2019s auto-configure mechanism takes care of configuring SpringBeans on\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2016-02-18T05:00:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Siva Reddy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/twitter.com\/sivalabs\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Siva Reddy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/02\\\/creating-custom-springboot-starter-twitter4j.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/02\\\/creating-custom-springboot-starter-twitter4j.html\"},\"author\":{\"name\":\"Siva Reddy\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/c4bc16742c140e793e22fe73a1b6f488\"},\"headline\":\"Creating Custom SpringBoot Starter for Twitter4j\",\"datePublished\":\"2016-02-18T05:00:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/02\\\/creating-custom-springboot-starter-twitter4j.html\"},\"wordCount\":640,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/02\\\/creating-custom-springboot-starter-twitter4j.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"keywords\":[\"Spring\",\"Twitter4j\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/02\\\/creating-custom-springboot-starter-twitter4j.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/02\\\/creating-custom-springboot-starter-twitter4j.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/02\\\/creating-custom-springboot-starter-twitter4j.html\",\"name\":\"Creating Custom SpringBoot Starter for Twitter4j - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/02\\\/creating-custom-springboot-starter-twitter4j.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/02\\\/creating-custom-springboot-starter-twitter4j.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"datePublished\":\"2016-02-18T05:00:08+00:00\",\"description\":\"SpringBoot provides lot of starter modules to get up and running quickly. SpringBoot\u2019s auto-configure mechanism takes care of configuring SpringBeans on\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/02\\\/creating-custom-springboot-starter-twitter4j.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/02\\\/creating-custom-springboot-starter-twitter4j.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/02\\\/creating-custom-springboot-starter-twitter4j.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"spring-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/02\\\/creating-custom-springboot-starter-twitter4j.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Creating Custom SpringBoot Starter for Twitter4j\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/c4bc16742c140e793e22fe73a1b6f488\",\"name\":\"Siva Reddy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/57171cbc9a028e211086675fa890ef348d8da6113ee2e16e74aadad2261d21c8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/57171cbc9a028e211086675fa890ef348d8da6113ee2e16e74aadad2261d21c8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/57171cbc9a028e211086675fa890ef348d8da6113ee2e16e74aadad2261d21c8?s=96&d=mm&r=g\",\"caption\":\"Siva Reddy\"},\"description\":\"Katamreddy Siva Prasad is a Senior Software Engineer working in E-Commerce domain. His areas of interest include Object Oriented Design, SOLID Design principles, RESTful WebServices and OpenSource softwares including Spring, MyBatis and Jenkins.\",\"sameAs\":[\"http:\\\/\\\/sivalabs.blogspot.com\\\/\",\"https:\\\/\\\/x.com\\\/http:\\\/\\\/twitter.com\\\/sivalabs\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/siva-reddy\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating Custom SpringBoot Starter for Twitter4j - Java Code Geeks","description":"SpringBoot provides lot of starter modules to get up and running quickly. SpringBoot\u2019s auto-configure mechanism takes care of configuring SpringBeans on","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html","og_locale":"en_US","og_type":"article","og_title":"Creating Custom SpringBoot Starter for Twitter4j - Java Code Geeks","og_description":"SpringBoot provides lot of starter modules to get up and running quickly. SpringBoot\u2019s auto-configure mechanism takes care of configuring SpringBeans on","og_url":"https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2016-02-18T05:00:08+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","type":"image\/jpeg"}],"author":"Siva Reddy","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/twitter.com\/sivalabs","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Siva Reddy","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html"},"author":{"name":"Siva Reddy","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/c4bc16742c140e793e22fe73a1b6f488"},"headline":"Creating Custom SpringBoot Starter for Twitter4j","datePublished":"2016-02-18T05:00:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html"},"wordCount":640,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","keywords":["Spring","Twitter4j"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html","url":"https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html","name":"Creating Custom SpringBoot Starter for Twitter4j - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","datePublished":"2016-02-18T05:00:08+00:00","description":"SpringBoot provides lot of starter modules to get up and running quickly. SpringBoot\u2019s auto-configure mechanism takes care of configuring SpringBeans on","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","width":150,"height":150,"caption":"spring-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2016\/02\/creating-custom-springboot-starter-twitter4j.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Creating Custom SpringBoot Starter for Twitter4j"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/c4bc16742c140e793e22fe73a1b6f488","name":"Siva Reddy","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/57171cbc9a028e211086675fa890ef348d8da6113ee2e16e74aadad2261d21c8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/57171cbc9a028e211086675fa890ef348d8da6113ee2e16e74aadad2261d21c8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/57171cbc9a028e211086675fa890ef348d8da6113ee2e16e74aadad2261d21c8?s=96&d=mm&r=g","caption":"Siva Reddy"},"description":"Katamreddy Siva Prasad is a Senior Software Engineer working in E-Commerce domain. His areas of interest include Object Oriented Design, SOLID Design principles, RESTful WebServices and OpenSource softwares including Spring, MyBatis and Jenkins.","sameAs":["http:\/\/sivalabs.blogspot.com\/","https:\/\/x.com\/http:\/\/twitter.com\/sivalabs"],"url":"https:\/\/www.javacodegeeks.com\/author\/siva-reddy"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/52580","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=52580"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/52580\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/240"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=52580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=52580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=52580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}