NoIssue: Cleanup
This commit is contained in:
@@ -29,8 +29,7 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
// The test classes are compiled with these:
|
||||
implementation("com.r35157.libs:valuetypes-basic-api:0.0.0")
|
||||
implementation("com.r35157.libs:valuetypes-basic-impl-ref:0.0.0")
|
||||
implementation("com.r35157.libs:valuetypes-basic-api:0.1-dev")
|
||||
implementation("org.jetbrains:annotations:26.0.1")
|
||||
|
||||
// The JUnit platform will not be included in the JAR file but are needed for running the tests:
|
||||
|
||||
@@ -1,52 +1,14 @@
|
||||
package com.r35157.libs.valuetypes.basic.tests;
|
||||
|
||||
import com.r35157.libs.valuetypes.basic.SomeInterface;
|
||||
import com.r35157.libs.valuetypes.basic.impl.ref.SomeImpl;
|
||||
import org.junit.jupiter.api.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
@DisplayName("Happy Initialization Tests")
|
||||
public class HappyInitializationTests {
|
||||
|
||||
@BeforeAll
|
||||
public static void beforeAll() {
|
||||
System.out.println("==== Before All");
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
public void beforeEach() {
|
||||
System.out.println("---- Before Each");
|
||||
}
|
||||
|
||||
@DisplayName("Just a basic test")
|
||||
@Test
|
||||
void someBasicTest() {
|
||||
// Arrange
|
||||
String a = "abc";
|
||||
String b = "def";
|
||||
String expected = "abcdef";
|
||||
SomeInterface sut = new SomeImpl();
|
||||
|
||||
// Act
|
||||
String actual = sut.concat(a, b);
|
||||
|
||||
// Assert
|
||||
assertTrue(actual.equals(expected));
|
||||
}
|
||||
|
||||
@Disabled("Test disabled")
|
||||
@Test
|
||||
void dummyTest2() {
|
||||
assertTrue(false);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void afterEach() {
|
||||
System.out.println("**** After Each");
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
public static void afterAll() {
|
||||
System.out.println("==== After All");
|
||||
assertTrue(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.r35157.libs.valuetypes.basic.tests;
|
||||
|
||||
import com.r35157.libs.valuetypes.basic.SomeInterface;
|
||||
import com.r35157.libs.valuetypes.basic.impl.ref.SomeImpl;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
@@ -9,48 +7,9 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
@DisplayName("Sad Initialization Tests")
|
||||
public class SadInitializationTests {
|
||||
|
||||
@BeforeAll
|
||||
public static void beforeAll() {
|
||||
System.out.println("==== Before All");
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
public void beforeEach() {
|
||||
System.out.println("---- Before Each");
|
||||
}
|
||||
|
||||
@DisplayName("Just another basic test")
|
||||
@Test
|
||||
void anotherBasicTest() {
|
||||
|
||||
// Arrange + act
|
||||
SomeInterface sut = new SomeImpl();
|
||||
String expectedErrorMsg = "/ by zero";
|
||||
|
||||
ArithmeticException thrown = assertThrows(
|
||||
ArithmeticException.class,
|
||||
sut::divideByZero,
|
||||
"Expected an exception to be thrown while dividing by zero, but it didn't"
|
||||
);
|
||||
String actualErrorMsg = thrown.getMessage();
|
||||
|
||||
// Assert
|
||||
assertEquals(expectedErrorMsg, actualErrorMsg);
|
||||
}
|
||||
|
||||
@Disabled("Test disabled")
|
||||
@Test
|
||||
void dummyTest2() {
|
||||
assertTrue(false);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void afterEach() {
|
||||
System.out.println("**** After Each");
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
public static void afterAll() {
|
||||
System.out.println("==== After All");
|
||||
assertFalse(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user