assertNotNull(optional);
assertTrue("Operational toaster not present", optional.isPresent());
- Toaster toasterData = optional.get();
+ Toaster toasterData = optional.orElseThrow();
assertEquals(Toaster.ToasterStatus.Up, toasterData.getToasterStatus());
assertEquals(new DisplayString("Opendaylight"), toasterData.getToasterManufacturer());
// NOTE: In a real test we would want to override the Thread.sleep() to
// prevent our junit test
// for sleeping for a second...
- Future<RpcResult<MakeToastOutput>> makeToast = toaster.makeToast(toastInput);
+ Future<RpcResult<MakeToastOutput>> makeToast = toaster.invoke(toastInput);
RpcResult<MakeToastOutput> rpcResult = makeToast.get();