Skip to content

Commit

Permalink
spotless apply
Browse files Browse the repository at this point in the history
Signed-off-by: georgi-l95 <[email protected]>
  • Loading branch information
georgi-l95 committed Sep 17, 2024
1 parent 42cb4fc commit ed03cf2
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 65 deletions.
50 changes: 22 additions & 28 deletions suites/src/main/java/com/hedera/block/suites/BaseSuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,41 +24,37 @@
import org.testcontainers.utility.DockerImageName;

/**
* BaseSuite is an abstract class that provides common setup and teardown functionality
* for test suites using Testcontainers to manage a Docker container for the Block Node server.
* <p>
* This class is responsible for:
* BaseSuite is an abstract class that provides common setup and teardown functionality for test
* suites using Testcontainers to manage a Docker container for the Block Node server.
*
* <p>This class is responsible for:
*
* <ul>
* <li>Starting a Docker container running the Block Node server with a specified version.</li>
* <li>Stopping the container after tests have been executed.</li>
* <li>Starting a Docker container running the Block Node server with a specified version.
* <li>Stopping the container after tests have been executed.
* </ul>
* <p>
* The Block Node server version is retrieved dynamically from an environment file (.env).
* </p>
*
* <p>The Block Node server version is retrieved dynamically from an environment file (.env).
*/
public abstract class BaseSuite {

/**
* Container running the Block Node server
*/
/** Container running the Block Node server */
protected static GenericContainer<?> blockNodeContainer;

/**
* Default constructor for the BaseSuite class.
* <p>
* This constructor can be used by subclasses or the testing framework to initialize
* the BaseSuite. It does not perform any additional setup.
* </p>
*
* <p>This constructor can be used by subclasses or the testing framework to initialize the
* BaseSuite. It does not perform any additional setup.
*/
public BaseSuite() {
// No additional setup required
}

/**
* Setup method to be executed before all tests.
* <p>
* This method initializes the Block Node server container using Testcontainers.
* </p>
*
* <p>This method initializes the Block Node server container using Testcontainers.
*/
@BeforeAll
public static void setup() {
Expand All @@ -74,10 +70,9 @@ public static void setup() {

/**
* Teardown method to be executed after all tests.
* <p>
* This method stops the Block Node server container if it is running. It ensures that resources
* are cleaned up after the test suite execution is complete.
* </p>
*
* <p>This method stops the Block Node server container if it is running. It ensures that
* resources are cleaned up after the test suite execution is complete.
*/
@AfterAll
public static void teardown() {
Expand All @@ -88,11 +83,10 @@ public static void teardown() {

/**
* Retrieves the Block Node server version from the .env file.
* <p>
* This method loads the .env file from the "../server/docker" directory and extracts the value
* of the "VERSION" environment variable, which represents the version of the Block Node server
* to be used in the container.
* </p>
*
* <p>This method loads the .env file from the "../server/docker" directory and extracts the
* value of the "VERSION" environment variable, which represents the version of the Block Node
* server to be used in the container.
*
* @return the version of the Block Node server as a string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,27 @@
import org.junit.platform.suite.api.Suite;

/**
* StreamTestSuites is a test suite that aggregates and runs a set of test classes
* related to the stream processing functionality of the Block Node.
* <p>
* This suite includes both positive and negative test cases.
* </p>
* <p>
* The suite uses the {@link org.junit.platform.suite.api.Suite} annotation to indicate that
* this class is an entry point for running multiple test classes together.
* </p>
* It selects the following test classes:
* StreamTestSuites is a test suite that aggregates and runs a set of test classes related to the
* stream processing functionality of the Block Node.
*
* <p>This suite includes both positive and negative test cases.
*
* <p>The suite uses the {@link org.junit.platform.suite.api.Suite} annotation to indicate that this
* class is an entry point for running multiple test classes together. It selects the following test
* classes:
*
* <ul>
* <li>{@link com.hedera.block.suites.stream.positive.PositiveBlockStreamTests}</li>
* <li>{@link com.hedera.block.suites.stream.negative.NegativeBlockStreamTests}</li>
* <li>{@link com.hedera.block.suites.stream.positive.PositiveBlockStreamTests}
* <li>{@link com.hedera.block.suites.stream.negative.NegativeBlockStreamTests}
* </ul>
*/
@Suite
@SelectClasses({PositiveBlockStreamTests.class, NegativeBlockStreamTests.class})
public class StreamTestSuites {
/**
* Default constructor for the StreamTestSuites class.
* <p>
* This constructor is required by the JUnit framework to run the suite.
* </p>
*
* <p>This constructor is required by the JUnit framework to run the suite.
*/
public StreamTestSuites() {
// No additional setup required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,21 @@
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;


/**
* TBD
*/
/** TBD */
@DisplayName("Negative Block Stream Tests")
public class NegativeBlockStreamTests extends BaseSuite {

/**
* Default constructor for the NegativeBlockStreamTests class.
* <p>
* This constructor is required by the testing framework (JUnit) to create instances of the test class.
* It does not perform any additional setup.
* </p>
*
* <p>This constructor is required by the testing framework (JUnit) to create instances of the
* test class. It does not perform any additional setup.
*/
public NegativeBlockStreamTests() {
// No additional setup required
}

/**
* TBD
*/
/** TBD */
@Test
public void testInvalidBlockStreamProcessing() {
assertTrue(blockNodeContainer.isRunning());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,21 @@
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;


/**
* TBD
*/
/** TBD */
@DisplayName("Positive Block Stream Tests")
public class PositiveBlockStreamTests extends BaseSuite {

/**
* Default constructor for the PositiveBlockStreamTests class.
* <p>
* This constructor is required by the testing framework (JUnit) to create instances of the test class.
* It does not perform any additional setup.
* </p>
*
* <p>This constructor is required by the testing framework (JUnit) to create instances of the
* test class. It does not perform any additional setup.
*/
public PositiveBlockStreamTests() {
// No additional setup required
}

/**
* TBD
*/
/** TBD */
@Test
public void testValidBlockStreamProcessing() {
assertTrue(blockNodeContainer.isRunning());
Expand Down

0 comments on commit ed03cf2

Please sign in to comment.