blob: d5cf53432382f694d155c45777249afcc29bc0a7 [file]
package com.apigee.security.oas;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.catchThrowable;
import com.google.inject.Guice;
import com.google.inject.Injector;
import java.io.PrintWriter;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class CommandLineModuleTest {
private Injector injector;
@Before
public void setup() {
injector = Guice.createInjector(new CommandLineModule());
}
@Test
public void createCommandLineParser_shouldNotThrowException() {
assertThat(catchThrowable(() -> injector.getInstance(CommandLineParser.class)))
.doesNotThrowAnyException();
}
@Test
public void createCommandLineArgs_shouldNotThrowException() {
assertThat(catchThrowable(() -> injector.getInstance(CommandLineArgs.class)))
.doesNotThrowAnyException();
}
@Test
public void createPrintWriter_shouldNotThrowException() {
assertThat(catchThrowable(() -> injector.getInstance(PrintWriter.class).close()))
.doesNotThrowAnyException();
}
}