Skip to content

Commit

Permalink
Increase code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mekya committed Feb 8, 2025
1 parent 57bbe02 commit 470e076
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/java/org/red5/server/tomcat/TomcatLoaderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
import org.apache.catalina.Host;
import org.junit.Test;

import io.antmedia.cluster.IClusterNotifier;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.*;

public class TomcatLoaderTest {
Expand Down Expand Up @@ -48,4 +51,19 @@ public void testHandleParseException() {
throw new RuntimeException(e);
}
}

@Test
public void testClusterNotifier() {

TomcatLoader tomcatLoader = spy(new TomcatLoader());

assertNull(tomcatLoader.getClusterNotifier());

IClusterNotifier clusterNotifier = mock(IClusterNotifier.class);
tomcatLoader.setClusterNotifier(clusterNotifier);


assertEquals(clusterNotifier, tomcatLoader.getClusterNotifier());

}
}

0 comments on commit 470e076

Please sign in to comment.