Skip to content
Snippets Groups Projects
Commit eaa07522 authored by Martin Hustoles's avatar Martin Hustoles
Browse files

fixed tests

parent d97c4332
Loading
...@@ -58,7 +58,7 @@ public class CPClientCookieRequestTest { ...@@ -58,7 +58,7 @@ public class CPClientCookieRequestTest {
when(phyProtocolMock.receive(anyInt())).thenReturn(testMsg); when(phyProtocolMock.receive(anyInt())).thenReturn(testMsg);
// Run the test // Run the test
assertDoesNotThrow(()->cProtocol.requestCookie()); assertDoesNotThrow(()->cProtocol.requestCookie(1));
// verify a specified behavior // verify a specified behavior
verify(phyProtocolMock, times(1)).receive(2000); verify(phyProtocolMock, times(1)).receive(2000);
...@@ -77,7 +77,7 @@ public class CPClientCookieRequestTest { ...@@ -77,7 +77,7 @@ public class CPClientCookieRequestTest {
// Run the test // Run the test
assertThrows(CookieRequestException.class, assertThrows(CookieRequestException.class,
()->cProtocol.requestCookie()); ()->cProtocol.requestCookie(1));
verify(phyProtocolMock, times(1)).receive(2000); verify(phyProtocolMock, times(1)).receive(2000);
} }
...@@ -96,7 +96,7 @@ public class CPClientCookieRequestTest { ...@@ -96,7 +96,7 @@ public class CPClientCookieRequestTest {
when(phyProtocolMock.receive(anyInt())).thenReturn(corruptedPhyMsg).thenReturn(testMsg); when(phyProtocolMock.receive(anyInt())).thenReturn(corruptedPhyMsg).thenReturn(testMsg);
// Run the test // Run the test
assertDoesNotThrow(()->cProtocol.requestCookie()); assertDoesNotThrow(()->cProtocol.requestCookie(1));
verify(phyProtocolMock, times(2)).receive(2000); verify(phyProtocolMock, times(2)).receive(2000);
} }
...@@ -113,7 +113,7 @@ public class CPClientCookieRequestTest { ...@@ -113,7 +113,7 @@ public class CPClientCookieRequestTest {
when(phyProtocolMock.receive(anyInt())).thenReturn(corruptedMsg).thenReturn(testMsg); when(phyProtocolMock.receive(anyInt())).thenReturn(corruptedMsg).thenReturn(testMsg);
// Run the test // Run the test
assertDoesNotThrow(()->cProtocol.requestCookie()); assertDoesNotThrow(()->cProtocol.requestCookie(1));
verify(phyProtocolMock, times(2)).receive(2000); verify(phyProtocolMock, times(2)).receive(2000);
} }
...@@ -130,7 +130,7 @@ public class CPClientCookieRequestTest { ...@@ -130,7 +130,7 @@ public class CPClientCookieRequestTest {
when(phyProtocolMock.receive(anyInt())).thenReturn(corruptedMsg).thenReturn(testMsg); when(phyProtocolMock.receive(anyInt())).thenReturn(corruptedMsg).thenReturn(testMsg);
// Run the test // Run the test
assertDoesNotThrow(()->cProtocol.requestCookie()); assertDoesNotThrow(()->cProtocol.requestCookie(1));
verify(phyProtocolMock, times(2)).receive(anyInt()); verify(phyProtocolMock, times(2)).receive(anyInt());
} }
...@@ -143,7 +143,7 @@ public class CPClientCookieRequestTest { ...@@ -143,7 +143,7 @@ public class CPClientCookieRequestTest {
// Run the test // Run the test
assertThrows(CookieRequestException.class, assertThrows(CookieRequestException.class,
()->cProtocol.requestCookie()); ()->cProtocol.requestCookie(1));
verify(phyProtocolMock, times(3)).receive(2000); verify(phyProtocolMock, times(3)).receive(2000);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment