File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed
impl/test/src/test/java/io/serverlessworkflow/impl/test Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change 4141import org .junit .jupiter .api .AfterAll ;
4242import org .junit .jupiter .api .BeforeAll ;
4343import org .junit .jupiter .api .Test ;
44+ import org .junit .jupiter .api .condition .DisabledIf ;
45+ import org .slf4j .Logger ;
46+ import org .slf4j .LoggerFactory ;
4447
48+ @ DisabledIf ("checkDocker" )
4549public class ContainerTest {
4650
4751 private static DockerClient dockerClient ;
48- private static WorkflowApplication app ;
52+ private static Logger logger = LoggerFactory . getLogger ( ContainerTest . class ) ;
4953
50- @ BeforeAll
51- static void init () {
54+ {
5255 DefaultDockerClientConfig defaultConfig =
5356 DefaultDockerClientConfig .createDefaultConfigBuilder ().build ();
5457 dockerClient =
5558 DockerClientImpl .getInstance (
5659 defaultConfig ,
5760 new ApacheDockerHttpClient .Builder ().dockerHost (defaultConfig .getDockerHost ()).build ());
61+ }
62+
63+ @ SuppressWarnings ("unused" )
64+ private static boolean checkDocker () {
65+ try {
66+ dockerClient .pingCmd ().exec ();
67+ return false ;
68+ } catch (Exception ex ) {
69+ logger .warn ("Docker is not running, disabling container test" );
70+ return true ;
71+ }
72+ }
73+
74+ private static WorkflowApplication app ;
75+
76+ @ BeforeAll
77+ static void init () {
5878 app = WorkflowApplication .builder ().build ();
5979 }
6080
6181 @ AfterAll
6282 static void cleanup () throws IOException {
63- dockerClient .close ();
6483 app .close ();
6584 }
6685
You can’t perform that action at this time.
0 commit comments