### Question:
RestRemoteMole implements Mole { @Override public Flux<AgencyState> states() { return clientUtils.flux("/states", AgencyStateDto.class) .map(AgencyStateDto::toAgencyState); } 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 availableMissions() { RestRemoteMole remoteMole = new RestRemoteMole(baseUrl); Set<Mission> missions = remoteMole.states().map(AgencyState::executableMissions).blockLast(); assertThat(missions.size()).isEqualTo(2); assertThat(missions.contains(new Mission("run a Marathon"))).isTrue(); }
@Ignore @Test(expected = IllegalArgumentException.class) public void availableMissionsReturnsAnError() { RestRemoteMole remoteMole = new RestRemoteMole(baseUrl); when(mole.states()).thenThrow(new IllegalArgumentException("the mole is returning an error")); remoteMole.states(); }
@Ignore @Test(expected = Exception.class) public void testWrongUriThrows() { RestRemoteMole remoteMole = new RestRemoteMole("http: remoteMole.states().blockFirst(); }