Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 1.2 KB

README.md

File metadata and controls

56 lines (40 loc) · 1.2 KB

legacyutils (by GMaur)

Importing the dependency

Add JitPack as a repository:

<repositories>
  <repository>
      <id>jitpack.io</id>
      <url>https://jitpack.io</url>
  </repository>
</repositories>

Add to dependencies:

<dependency>
    <groupId>com.github.gmaur</groupId>
    <artifactId>legacyutils</artifactId>
    <version>v0.0.1</version>
</dependency>

See JitPack for more information (gradle/leiningen/sbt/maven): https://jitpack.io/#gmaur/legacyutils/

Using the dependency

A quick example:

import com.gmaur.legacycode.legacyutils.output.MockSystemOutput;

@Test
public void inject_the_system_output() {
  // inject the SystemOutput
  final MockSystemOutput systemOutput = MockSystemOutput.inject();

  // do your logic that prints to the System.out
  your_logic_here();

  // you can catch the output using:
  assertThat(systemOutput.toString(), equalTo("hello world!" + System.System.lineSeparator()));
}

public void your_logic_here() {
  System.out.println("hello world!");
}

See the tests for more information

License

LGPL3