import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-
import com.google.common.base.Optional;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import java.io.FileNotFoundException;
import java.net.URI;
import java.text.ParseException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map.Entry;
import java.util.Set;
import javax.ws.rs.core.MultivaluedHashMap;
-import javax.ws.rs.core.Response;
+import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
import org.junit.Before;
doReturn(mount).when(iiCtx).getMountPoint();
final DOMRpcService rpcService = mock(DOMRpcService.class);
doReturn(Optional.of(rpcService)).when(mount).getService(DOMRpcService.class);
- doReturn(Futures.immediateCheckedFuture(mock(DOMRpcResult.class))).when(rpcService).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
+ doReturn(Futures.immediateCheckedFuture(mock(DOMRpcResult.class))).when(rpcService)
+ .invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
this.restconfImpl.invokeRpc("randomId", ctx, uriInfo);
this.restconfImpl.invokeRpc("ietf-netconf", ctx, uriInfo);
verify(rpcService, times(2)).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
when(uriBuilder.build()).thenReturn(new URI(""));
when(uriBuilder.scheme("ws")).thenReturn(uriBuilder);
when(uriInfo.getAbsolutePathBuilder()).thenReturn(uriBuilder);
+ final MultivaluedMap<String, String> map = mock(MultivaluedMap.class);
+ final Set<Entry<String, List<String>>> set = new HashSet<>();
+ when(map.entrySet()).thenReturn(set);
+ when(uriInfo.getQueryParameters()).thenReturn(map);
final BrokerFacade brokerFacade = mock(BrokerFacade.class);
this.restconfImpl.setBroker(brokerFacade);
// subscribe to stream and verify response
- final Response response = this.restconfImpl.subscribeToStream(identifier, uriInfo);
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
+ final NormalizedNodeContext response = this.restconfImpl.subscribeToStream(identifier, uriInfo);
// remove test notification stream
Notificator.removeAllListeners();