25.02.2015 Views

Introducing Spring Framework

Introducing Spring Framework

Introducing Spring Framework

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 17 ■ Be Social and Go Mobile<br />

In Listing 17-6, you are using the DocumentService and TypeService implementations. The TypeService<br />

implementation is used just to retrieve the web type because it is required when you create a new document. Then you<br />

create a new document and call the saveDocument method; this will save the document into the database and you can<br />

tweet about it.<br />

Now if you run the test (see Listing 17-6) with<br />

gradle :ch17:test<br />

you should get the following output:<br />

com.apress.isf.spring.test.MyDocumentsTest > testMyDocumentsTwitter STARTED<br />

Test: test testMyDocumentsTwitter(com.apress.isf.spring.test.MyDocumentsTest) produced standard<br />

out/err: 2014-05-17 17:09:37,253 DEBUG [Test worker] Testing My Documents with <strong>Spring</strong> Social....<br />

com.apress.isf.spring.test.MyDocumentsTest > testMyDocumentsTwitter PASSED<br />

You should also see in your Twitter account something similar to Figure 17-15.<br />

Figure 17-15. A Tweet Using the My Documents <strong>Spring</strong> Application<br />

Summary<br />

In this chapter, you learned about <strong>Spring</strong> Social and how easy it is to integrate your My Documents <strong>Spring</strong> application<br />

with Twitter. You also learned how to register an application on Twitter in order to use Twitter’s REST API.<br />

In the next chapter, you will discover more features about the <strong>Spring</strong> <strong>Framework</strong>, such as a way to create an entire<br />

application with the Groovy programming language and <strong>Spring</strong>.<br />

250

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!