[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-701154-105":59,"doc-detail-701154-en":130,"doc-similar-701154":160},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","les25-introduction-to-unit-testing-unit-testing","Les25 - Introduction to unit testing - Unit Testing","","Lecture material on unit testing in Java with Spring Boot, explaining why testing is needed for product quality, security, customer satisfaction, and cost savings. Covers the fundamentals of Test Driven Development (TDD) life cycle, compares unit tests with integration tests, and outlines how integration tests can span layers and full request paths. Provides a basic Java test structure and introduces JUnit 5, key annotations concepts, and Mockito-based mocking.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/les25-introduction-to-unit-testing-unit-testing/701154/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/les25-introduction-to-unit-testing-unit-testing/701154.png","ImageObject",300,407,{"name":92,"@type":93},"RuangKosong","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-18","2026-11-12",true,{"@type":102,"interactionType":103,"userInteractionCount":19},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"Why is software testing required in business development?","Question",{"text":112,"@type":113},"Testing is needed to ensure product quality, improve security, increase customer satisfaction, and save money.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"What are the main steps in the TDD life cycle?",{"text":117,"@type":113},"TDD starts by writing a failing test, then writing just enough code to pass it, and finally refactoring code for improvement without changing behavior.",{"name":119,"@type":110,"acceptedAnswer":120},"How do unit tests differ from integration tests in Spring Boot?",{"text":121,"@type":113},"A unit test covers a single unit such as one class, while an integration test can cover multiple units, multiple layers, or the whole application path, such as a Web REST API request flow.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},701154,1794523810,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":19,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":52,"language":139,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":67,"update_tm":129,"read_time":143,"preview_page_count":19,"preview_urls":144},962090883219,"https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c","Software Engineering  \na.a . 2018  \n-  \n2019  \nTesting for Spring Boot Prof. Luca Mainetti  \nUniversity of Salento  \nSoftware Testing – Why?  \nIt’s required to stay in the business!  \n! Product Quality  \n! Security  \n! Customer Satisfaction  \n! Software Testing Saves Money  \nJUnit e Testing Tools  \n2 Luca Mainetti  \nTest Driven Development  \n! TDD life cycle:  \n– Writing a failing test  \n– Write just enough code to pass it  \n– Change code for better without changing its behaviour  \nCode REFACTOR  \nTest PASSED  \nJUnit e Testing Tools  \n3 Luca Mainetti  \nTesting Spring Boot  \n! Three kinds of Test for Spring Boot:  \n– Unit Test  \n• Test a single unit of code  \n– Integration test  \n• Test a set of different architecture concerns (e.i. , cross-cutting)  \n• The most common integration test: Web Controller/REST API Test  \nJUnit e Testing Tools  \n4 Luca Mainetti  \nUnit test vs . Integration test  \n! A unit test covers a single “unit”: a single class! An integration test can be any of the following:  \n– a test that covers multiple “units”  \n– a test that covers multiple layers: it might cover the interaction between a business service and the persistence layer, for instance.  \n– a test that covers the whole path through the application: let’s send a request to the application and check that it responds correctly and has changed the database state according to our expectations.  \n– For example, Web REST API Test covers the following phases:  \n– Listen to [HTTP Requests](HTTP Requests)  \n– Deserialize Input  \n– Validate Input  \n– Call the Business Logic  \n– Serialize the Output  \n– Translate Exceptions  \nJUnit e Testing Tools  \n5 Luca Mainetti  \nStructure of Test in Java  \npublic class NameOfClassTest {  \nprivate class attributes;  \n@Before  \nvoid public setUp() {  \n// set up the environment;  \n}  \n@Test  \nvoid testMethod1() {  \n}  \n// list of assertions assertThat( ) ;  \n@Test  \nvoid testMethod2() {  \n…  \n@After  \nvoid public clean() {  \n// clean the environment;}  \nJUnit e Testing Tools  \n6 Luca Mainetti  \nJunitIntroduction  \n! JUnit is the most popular Java Unit testing framework  \n! Before unit testing, we depend on deploying the entire app and checking if the screens look great. But that’s not very efficient. And it is manual.  \n! Unit Testing focuses on writing automated tests for individual classes and methods.  \n! JUnit is a framework which will help you call a method and check (or assert) whether the output is as expected.  \n! The important thing about automation testing is that these tests can be run with continuous integration-as soon as some code changes.  \n! Current stable version: JUnit 5  \nJUnit e Testing Tools  \n7 Luca Mainetti  \nJUnit5 – Annotations  \nJUnit e Testing Tools  \n8 Luca Mainetti  \nMock-up with Mockito  \n! Mocking is creating objects that simulate the behavior of real objects.  \n– An object under test may have dependencies on other (complex) objects  \n– Mocks are useful if the real objects are impractical to incorporate into the unit test (i.e. , in development/test environment)  \n! Mockito is the most popular mocking framework in Java! Current stable version: 2  \nJUnit e Testing Tools  \n9 Luca Mainetti  \nReferences  \n! JUnit5 official user guide:  \n[https://junit.org/junit5/docs/current/user-guide/](https://junit.org/junit5/docs/current/user-guide/)  \n! JUnit5 list of  \nasserts: [https://junit.org/junit5/docs/5.0.1/api/org/junit/jupiter/](https://junit.org/junit5/docs/5.0.1/api/org/junit/jupiter/)[ ](https://junit.org/junit5/docs/5.0.1/api/org/junit/jupiter/)[api/Assertions.html](api/Assertions.html)  \n! Mockito: [http://site.mockito.org/](http://site.mockito.org/)  \nJUnit e Testing Tools  \n10 Luca Mainetti","cbCaibJuE9ccq5Yq","https://ap.wps.com/l/cbCaibJuE9ccq5Yq","pdf",1276852,"English","# Software Testing – Why?\n## JUnit and Testing Tools\n# Test Driven Development (TDD)\n# Testing Spring Boot\n## Three kinds of Test for Spring Boot\n# Unit test vs Integration test\n## Web REST API test phases\n# Structure of Test in Java\n# JUnit Introduction\n## JUnit 5 current stable version\n# JUnit5 – Annotations\n# Mock-up with Mockito\n## Mockito current stable version\n# References","[{\"question\":\"Why is software testing required in business development?\",\"answer\":\"Testing is needed to ensure product quality, improve security, increase customer satisfaction, and save money.\"},{\"question\":\"What are the main steps in the TDD life cycle?\",\"answer\":\"TDD starts by writing a failing test, then writing just enough code to pass it, and finally refactoring code for improvement without changing behavior.\"},{\"question\":\"How do unit tests differ from integration tests in Spring Boot?\",\"answer\":\"A unit test covers a single unit such as one class, while an integration test can cover multiple units, multiple layers, or the whole application path, such as a Web REST API request flow.\"}]","Les25 - Introduction to unit testing - Unit Testing | PDF",25,[145,149,152,156],{"page_no":8,"url":146,"width":147,"height":148},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/b29d81ad1e4fd1813857c70de6b4b80c.webp",983,736,{"page_no":14,"url":150,"width":151,"height":148},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/1465f8828ec4f5c9d2ae780462f0a292.webp",982,{"page_no":81,"url":153,"width":154,"height":155},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/43380eb051974117830ff0b54b4b87d7.webp",981,735,{"page_no":19,"url":157,"width":158,"height":159},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/0c53d5e4f429218dd5d1e8456a55a753.webp",980,734,{"list":161,"token":66},[162,168,174,180,185,191,198,205,211,217],{"doc_id":163,"doc_title":164,"file_type":137,"home_preview_img_url":165,"slug":166,"view_count":24,"category_name":30,"create_tm":167},701158,"JUnit Tutorial - Beginner Guide - Java Unit Testing Framework","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012051946/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796120579&Signature=5OtL62HXBpM9UMGQeUBkCxD2gCY%3D","junit-tutorial-beginner-guide-java-unit-testing-framework",1794523817,{"doc_id":169,"doc_title":170,"file_type":137,"home_preview_img_url":171,"slug":172,"view_count":81,"category_name":30,"create_tm":173},701152,"JUnit 5 User Guide - Version 5.12.2","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012051873/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796120579&Signature=FsQllzGe8hoj%2B7KW9U0%2B4QSuEEE%3D","junit-5-user-guide-version-5122",1794523807,{"doc_id":175,"doc_title":176,"file_type":137,"home_preview_img_url":177,"slug":178,"view_count":24,"category_name":30,"create_tm":179},701156,"JUnit Tutorial","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012051926/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796120579&Signature=HXswa7so2MicmE0A7yt8N%2B3gQPk%3D","junit-tutorial",1794523814,{"doc_id":181,"doc_title":182,"file_type":137,"home_preview_img_url":183,"slug":184,"view_count":19,"category_name":30,"create_tm":173},701153,"Selenium + JUnit 5 - The Perfect Match - Meetup 2021","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012051883/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796120579&Signature=JjjYOYzWfSIfyWmyFfZzR6qlgJM%3D","selenium-junit-5-the-perfect-match-meetup-2021",{"doc_id":186,"doc_title":187,"file_type":137,"home_preview_img_url":188,"slug":189,"view_count":24,"category_name":30,"create_tm":190},701159,"Lab 2 - Javadoc, JUnit, & Debugging","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012051953/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796120579&Signature=jD0eIog04Y1LhstJIXt%2BaVsZp%2FQ%3D","lab-2-javadoc-junit-debugging",1794523820,{"doc_id":192,"doc_title":193,"file_type":137,"home_preview_img_url":194,"slug":195,"view_count":196,"category_name":30,"create_tm":197},489340,"Cloud Ready Web Applications with jHipster - White Paper","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229927229383/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796120579&Signature=dHq%2FmzriOD1EBkNdIDS3XfCqS2s%3D","cloud-ready-web-applications-with-jhipster-white-paper",21,1790822326,{"doc_id":199,"doc_title":200,"file_type":137,"home_preview_img_url":201,"slug":202,"view_count":203,"category_name":30,"create_tm":204},85450,"TENET: One Step Toward Test-Driven Development for Repository-Level Code Generation","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229809269417/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796120579&Signature=cLTTE1TOYh4P6YHWelyAPgfRgTg%3D","tenet-one-step-toward-test-driven-development-for-repository-level-code-generation",33,1784203642,{"doc_id":206,"doc_title":207,"file_type":137,"home_preview_img_url":208,"slug":209,"view_count":19,"category_name":30,"create_tm":210},696154,"Spring Boot Reference Guide - Version 1.1.0 M2 - reference guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230009756795/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796120579&Signature=xUJJj%2FkMuagEUagbdnyTd9x%2BnJY%3D","spring-boot-reference-guide-version-110-m2-reference-guide",1794431587,{"doc_id":212,"doc_title":213,"file_type":137,"home_preview_img_url":214,"slug":215,"view_count":8,"category_name":30,"create_tm":216},763091,"Selenium Tutorials - 32 Best Free Selenium Training Tutorials","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230046002684/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796120579&Signature=%2F7IXy9lMOsYi8tOBHJ6gZanFtZM%3D","selenium-tutorials-32-best-free-selenium-training-tutorials",1795999622,{"doc_id":218,"doc_title":219,"file_type":137,"home_preview_img_url":220,"slug":221,"view_count":81,"category_name":30,"create_tm":222},701171,"Practical Guide to Building an API Back End with Spring Boot - Version 1.0 - Copyright and publication information","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011580250/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796120579&Signature=SgmmFjfFCPU19ChYrtfjQaebRbc%3D","practical-guide-to-building-an-api-back-end-with-spring-boot-version-10-copyright-and-publication-information",1794523902]