Skip to content

Commit

Permalink
Added m6_01_assertFinanceClassExistence
Browse files Browse the repository at this point in the history
  • Loading branch information
hhimanshu committed May 23, 2020
1 parent 6fe71ed commit ad83ad5
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/test/java/com/h2/Module06_Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.h2;

import org.junit.jupiter.api.Test;
import org.junit.platform.commons.function.Try;

import java.util.Optional;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.platform.commons.util.ReflectionUtils.tryToLoadClass;

public class Module06_Test {
private final String classToFind = "com.h2.Utilities";

public Optional<Class<?>> getUtilitiesClass() {
Try<Class<?>> aClass = tryToLoadClass(classToFind);
return aClass.toOptional();
}

@Test
public void m6_01_assertFinanceClassExistence() {
final Optional<Class<?>> maybeClass = getUtilitiesClass();
assertTrue(maybeClass.isPresent(), classToFind + " should be present");
assertEquals(classToFind, maybeClass.get().getCanonicalName());
}
}

0 comments on commit ad83ad5

Please sign in to comment.