{"product_id":"9781783289967","title":"Instant Mock Testing with PowerMock","description":"\u003cb\u003eIn Detail\u003c\/b\u003e\u003cp\u003eWriting good unit tests can be hard in situations where we have to deal with static, final, or private methods. Sometimes, even a good design is sacrificed for the sake of testability. A mocking framework’s ability to create mocks for almost any scenario enables us to focus on accurately programming for a business environment.\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003eStarting with a basic example of how to create a mock and verify a method invocation Instant Testing with PowerMock then demonstrates various features of PowerMock using clear, practical, step-by-step recipes. By the end of this book, you will be able to write unit tests for almost any scenario and suppress unwanted behaviour to effectively unit test your code.\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003eMoving on from the basics, you will learn to write unit tests for static, final, and private methods, and write flexible unit tests using argument matchers. Following on from this, you will also learn how to mock a few methods of a class, and invoke real implementation of others using partial mocks or spies. This book will teach you the tricks of the trade that will enable you to write good unit tests for a wide range of scenarios.\u003c\/p\u003e\u003cp\u003e\u003cb\u003eApproach\u003c\/b\u003e\u003c\/p\u003e\u003cp\u003eFilled with practical, step-by-step instructions and clear explanations for the most important and useful tasks. A concise guide full of step-by-step recipes, to teach you how you can use PowerMock to unit test code.\u003c\/p\u003e\u003cp\u003e\u003cb\u003eWho this book is for\u003c\/b\u003e\u003c\/p\u003e\u003cp\u003eIf you are a beginner who would like to learn how to use PowerMock, this is the perfect guide for you! As the book comprehensively covers both basic and advanced concepts, this guide is also suitable for those of you who have an intermediate knowledge of PowerMock.\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e","brand":"Packt Publishing","offers":[{"title":"Default Title","offer_id":47183789883632,"sku":"9781783289967","price":10.49,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0737\/7593\/9824\/files\/9781783289967_p0.jpg?v=1763725681","url":"https:\/\/shop-qa.barnesandnoble.com\/products\/9781783289967","provider":"Barnes \u0026 Noble (DEV)","version":"1.0","type":"link"}