Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

Add closing message to websocket #71

Open
speedfl opened this issue Feb 1, 2022 · 0 comments
Open

Add closing message to websocket #71

speedfl opened this issue Feb 1, 2022 · 0 comments

Comments

@speedfl
Copy link

speedfl commented Feb 1, 2022

It could be nice to add to MockServer a close method for the andUpgradeToWebSocket.

Example:
https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodTest.java#L318-L344

could become:

server.expect().withPath("/api/v1/namespaces/test/pods/pod1/exec?command=ls&stdout=true")
            .andUpgradeToWebSocket()
                .open()
		.waitFor(1000).andEmit(new OutputStreamMessage("first message"))
		.waitFor(2000).andEmit(new OutputStreamMessage("second message"))
                .waitFor(3000).andEmit(new CloseReason(1000, "Status v1 as string")) // this will close the session
                .done()
            .always();
speedfl added a commit to speedfl/mockwebserver that referenced this issue Feb 1, 2022
speedfl added a commit to speedfl/mockwebserver that referenced this issue Feb 1, 2022
speedfl added a commit to speedfl/mockwebserver that referenced this issue Feb 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant