use of com.facebook.buck.doctor.config.DoctorConfig in project buck by facebook.
the class DoctorReportHelperTest method testNoAvailableSuggestions.
@Test
public void testNoAvailableSuggestions() throws Exception {
TestConsole console = new TestConsole();
DoctorConfig doctorConfig = DoctorConfig.of(FakeBuckConfig.builder().setSections(ImmutableMap.of(DoctorConfig.DOCTOR_SECTION, ImmutableMap.of(DoctorConfig.URL_FIELD, "url"))).build());
DoctorReportHelper helper = new DoctorReportHelper(workspace.asCell().getFilesystem(), (new UserInputFixture("0")).getUserInput(), console, objectMapper, doctorConfig);
DoctorEndpointResponse response = DoctorEndpointResponse.of(Optional.empty(), ImmutableList.of());
helper.presentResponse(response);
assertEquals("\n:: No available suggestions right now.\n\n", console.getTextWrittenToStdOut());
}
use of com.facebook.buck.doctor.config.DoctorConfig in project buck by facebook.
the class DoctorReportHelperTest method testErrorMessage.
@Test
public void testErrorMessage() throws Exception {
TestConsole console = new TestConsole();
DoctorConfig doctorConfig = DoctorConfig.of(FakeBuckConfig.builder().setSections(ImmutableMap.of(DoctorConfig.DOCTOR_SECTION, ImmutableMap.of(DoctorConfig.URL_FIELD, "url"))).build());
DoctorReportHelper helper = new DoctorReportHelper(workspace.asCell().getFilesystem(), (new UserInputFixture("0")).getUserInput(), console, objectMapper, doctorConfig);
String errorMessage = "This is an error message.";
DoctorEndpointResponse response = DoctorEndpointResponse.of(Optional.of(errorMessage), ImmutableList.of());
helper.presentResponse(response);
assertEquals("=> " + errorMessage + "\n", console.getTextWrittenToStdOut());
}
Aggregations