Git hub repository for the free Udemy course : https://www.udemy.com/junit-tutorial-for-beginners-with-java-examples/
- What is JUnit?
- Why Unit Testing?
@Test Annotation
- Running JUnit
- No Failure = Success
- Basic Assert methods
- assertTrue and assertFalse methods
- @Before @After annotations
- @BeforeClass @AfterClass annotations
- Comparing Arrays
- Testing Exceptions
- Performance Unit Tests
- Parameterized Tests
- Test Suites
- Naming Test Methods
- Highlight Important Values in Tests
- Handle Exceptions Properly
- Readable Assert Statements
package com.in28minutes.junit.helper;
public class StringHelper {
public String truncateAInFirst2Positions(String str) {
if (str.length() <= 2)
return str.replaceAll("A", "");
String first2Chars = str.substring(0, 2);
String stringMinusFirst2Chars = str.substring(2);
return first2Chars.replaceAll("A", "")
+ stringMinusFirst2Chars;
}
public boolean areFirstAndLastTwoCharactersTheSame(String str) {
if (str.length() <= 1)
return false;
if (str.length() == 2)
return true;
String first2Chars = str.substring(0, 2);
String last2Chars = str.substring(str.length() - 2);
return first2Chars.equals(last2Chars);
}
}
- At in28Minutes, we ask ourselves one question everyday. How do we create more effective trainings?
- We use Problem-Solution based Step-By-Step Hands-on Approach With Practical, Real World Application Examples.
- Our success on Udemy and Youtube (2 Million Views & 12K Subscribers) speaks volumes about the success of our approach.
- While our primary expertise is on Development, Design & Architecture Java & Related Frameworks (Spring, Struts, Hibernate) we are expanding into the front-end world (Bootstrap, JQuery, Angular JS).
- Best Course are interactive and fun.
- Foundations for building high quality applications are best laid down while learning.
- Problem Solution based Step by Step Hands-on Learning
- Practical, Real World Application Examples.
- We use 80-20 Rule. We discuss 20% things used 80% of time in depth. We touch upon other things briefly equipping you with enough knowledge to find out more on your own.
- We will be developing a demo application in the course, which could be reused in your projects, saving hours of your effort.
- All the code is available on Github, for most steps.
- Most Watched Courses on YouTube - 30,000 Subscribers
- 25 Videos and Articles for Beginners on Spring Boot
- Our Best Courses with 66,000 Students and 4,000 5-Star Ratings
- Java Interview Guide : 200+ Interview Questions and Answers
- First Web Application with Spring Boot
- Spring Boot Tutorial For Beginners
- Mockito Tutorial : Learn mocking with 25 Junit Examples
- Java EE Made Easy - Patterns, Architecture and Frameworks
- Spring MVC For Beginners : Build Java Web App in 25 Steps
- JSP Servlets For Beginners : Build Java Web App in 25 Steps
- Maven Tutorial - Manage Java Dependencies in 25 Steps
- Java OOPS in 1 Hours
- C Puzzle for Interview