- private void setRouteToReturnValid() throws IllegalAccessException {
- PowerMockito.mockStatic(IngressRoute.class);
- PowerMockito.when(IngressRoute.getIngressRoute(anyInt(), anyString(), anyString())).thenReturn(null);
- SortedSet<IngressRoute> ingressSet = new TreeSet();
- IngressRoute ingressRoute = mock(IngressRoute.class);
- JSONObject joIngress = mock(JSONObject.class);
- when(joIngress.toString()).thenReturn("{}");
- when(ingressRoute.asJSONObject()).thenReturn(joIngress);
- ingressSet.add(ingressRoute);
- PowerMockito.when(IngressRoute.getAllIngressRoutes()).thenReturn(ingressSet);
-
- PowerMockito.mockStatic(EgressRoute.class);
- PowerMockito.when(EgressRoute.getEgressRoute(anyInt())).thenReturn(null);
- SortedSet<EgressRoute> egressSet = new TreeSet();
- EgressRoute egressRoute = mock(EgressRoute.class);
- JSONObject joEgress = mock(JSONObject.class);
- when(joEgress.toString()).thenReturn("{}");
- when(egressRoute.asJSONObject()).thenReturn(joEgress);
- egressSet.add(egressRoute);
- PowerMockito.when(EgressRoute.getAllEgressRoutes()).thenReturn(egressSet);
-
- PowerMockito.mockStatic(NetworkRoute.class);
- SortedSet<NetworkRoute> networkSet = new TreeSet();
- PowerMockito.when(NetworkRoute.getAllNetworkRoutes()).thenReturn(networkSet);
-
- }
-
- private void setPokerToNotCreateTimersWhenDeleteFeedIsCalled() throws Exception {
- Poker poker = mock(Poker.class);
- FieldUtils.writeDeclaredStaticField(Poker.class, "poker", poker, true);