use of com.android.tools.idea.IdeInfo in project android by JetBrains.
the class UnresolvedDependenciesReporterTest method testReportWithConstraintLayout.
public void testReportWithConstraintLayout() throws Exception {
myOriginalIdeInfo = IdeInfo.getInstance();
IdeInfo ideInfo = IdeComponents.replaceServiceWithMock(IdeInfo.class);
when(ideInfo.isAndroidStudio()).thenReturn(true);
loadSimpleApplication();
mySyncMessagesStub.clearReportedMessages();
Module appModule = myModules.getAppModule();
when(mySyncIssue.getData()).thenReturn("com.android.support.constraint:constraint-layout:+");
myReporter.report(mySyncIssue, appModule, null);
SyncMessage message = mySyncMessagesStub.getFirstReportedMessage();
assertNotNull(message);
// @formatter:off
assertAbout(syncMessage()).that(message).hasGroup("Unresolved Android dependencies").hasMessageLine("Failed to resolve: com.android.support.constraint:constraint-layout:+", 0);
// @formatter:on
List<NotificationHyperlink> quickFixes = message.getQuickFixes();
assertThat(quickFixes).hasSize(2);
}
Aggregations