1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-26 14:22:05 +01:00

Revert "Add test for PGPainlessCLI main class"

This reverts commit af6fe0aaf7.
This commit is contained in:
Paul Schaub 2021-05-29 14:19:32 +02:00
parent 8e02df9a3e
commit 19ec715461

View file

@ -1,50 +0,0 @@
/*
* Copyright 2021 Paul Schaub.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.sop;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
public class MainClassTest {
private static OutputStream originalSout;
@BeforeAll
public static void saveOriginalSout() {
originalSout = System.out;
}
@Test
public void testMainByVersionCommand() {
ByteArrayOutputStream out = new ByteArrayOutputStream();
System.setOut(new PrintStream(out));
PGPainlessCLI.main(new String[] {"version"});
String version = out.toString();
assertTrue(version.startsWith("PGPainlessCLI"));
}
@AfterAll
public static void restoreOriginalSout() {
System.setOut(new PrintStream(originalSout));
}
}