### Question:
RestRemoteMole implements Mole { @Override public Mono<MissionHandle> instantiate(Mission mission, Map<String, Object> params) { String uri = MoleWebApi.instantiateMission(mission.name()); Mono<MissionHandleDto> responseBody = clientUtils .postMono(uri, APPLICATION_STREAM_JSON, fromObject(params), MissionHandleDto.class); return responseBody.map(MissionHandleDto::toMissionHandle); } RestRemoteMole(String baseUrl); @Override Flux<AgencyState> states(); @Override Mono<MissionRepresentation> representationOf(Mission mission); @Override Mono<MissionParameterDescription> parameterDescriptionOf(Mission mission); @Override Flux<MissionState> statesFor(MissionHandle handle); @Override Flux<MissionOutput> outputsFor(MissionHandle handle); @Override Flux<MissionRepresentation> representationsFor(MissionHandle handle); @Override Mono<MissionHandle> instantiate(Mission mission, Map<String, Object> params); @Override void instruct(MissionHandle handle, Strand strand, StrandCommand command); @Override void instructRoot(MissionHandle handle, StrandCommand command); @Override void instructBlock(MissionHandle handle, String blockId, BlockCommand command); @Override void instruct(final MissionHandle handle, final MissionCommand command);  }### Answer:
@Test public void instantiate() throws InterruptedException { RestRemoteMole remoteMole = new RestRemoteMole(baseUrl); Map<String, Object> params = new HashMap<>(); params.put("testValue", "param desc"); remoteMole.instantiate(new Mission("a mission"), params); TimeUnit.SECONDS.sleep(1); Mockito.verify(mole, Mockito.timeout(1000).atLeastOnce()).instantiate(any(), any()); }
@Ignore @Test(expected = IllegalArgumentException.class) public void instantiateReturnsError() { RestRemoteMole remoteMole = new RestRemoteMole(baseUrl); doThrow(new IllegalArgumentException("the mole is returning an error")) .when(mole).instantiate(any(), any()); remoteMole.instantiate(new Mission("a mission"), Collections.emptyMap()); }