Home

Awesome

JUnitIn28Minutes

Git hub repository for the free Udemy course : https://www.udemy.com/course/junit-tutorial-for-beginners-with-java-examples/

Get started with Junit

Topics

Section 1 Foundation

Section 2 First JUnit Example

@Test Annotation

Section 3 Second JUnit Example

Section 4 JUnit Simple Test Scenarios

Section 5 JUnit Intermediate Test Scenarios

Section 6 JUnit Best Practices

Starting Examples

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);
	}

}

About in28Minutes

Our Beliefs

Our Approach

About in28Minutes

At in28Minutes, we ask ourselves one question everyday

How do we create more amazing course experiences? We use 80-20 Rule. We discuss 20% things used 80% of time in depth.

We are creating amazing learning experiences for learning Spring Boot with AWS, Azure, GCP, Docker, Kubernetes and Full Stack. 300,000 Learners rely on our expertise. Find out more....

in28MinutesLearningRoadmap-July2019.png