Skip to content

Commit

Permalink
CXF-8863: Get rid of EasyMock in cxf-rt-transports-websocket (#1353)
Browse files Browse the repository at this point in the history
(cherry picked from commit 18772cc)
  • Loading branch information
reta committed Jul 31, 2023
1 parent 03e554c commit 3d40d62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
5 changes: 3 additions & 2 deletions rt/transports/websocket/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<groupId>org.mockito</groupId>
<artifactId>mockito-subclass</artifactId>
<version>${cxf.mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,38 +32,26 @@
import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory;
import org.apache.cxf.transport.websocket.jetty10.Jetty10WebSocketDestination;

import org.easymock.EasyMock;
import org.easymock.IMocksControl;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

import static org.mockito.Mockito.mock;
/**
*
*/
public class JettyWebSocketDestinationTest {
private static final String ENDPOINT_ADDRESS = "ws://localhost:9001/websocket/nada";
private static final QName ENDPOINT_NAME = new QName("urn:websocket:probe", "nada");

private IMocksControl control;

@Before
public void setUp() {
control = EasyMock.createNiceControl();
}

@Test
public void testRegisteration() throws Exception {
Bus bus = new ExtensionManagerBus();
DestinationRegistry registry = new HTTPTransportFactory().getRegistry();
EndpointInfo endpoint = new EndpointInfo();
endpoint.setAddress(ENDPOINT_ADDRESS);
endpoint.setName(ENDPOINT_NAME);
JettyHTTPServerEngine engine = EasyMock.createMock(JettyHTTPServerEngine.class);

control.replay();
JettyHTTPServerEngine engine = mock(JettyHTTPServerEngine.class);

TestJettyWebSocketDestination dest = new TestJettyWebSocketDestination(bus, registry, endpoint, null, engine);

Expand Down

0 comments on commit 3d40d62

Please sign in to comment.