@Test
  public void testInvalidServiceInfo() {
    // Given
    ServiceInfo serviceInfo = new ServiceInfo();
    serviceInfo.setName("TEST_SERVICE");
    serviceInfo.setVersion("1.0.0");
    serviceInfo.setValid(false);
    serviceInfo.addError("Test error message");


    // When
    ServiceModule serviceModule = createServiceModule(serviceInfo);

    // Then
    assertFalse("Service module should be invalid due to the service info being invalid !", serviceModule.isValid());

    assertTrue("Service module error collection should contain error message that caused service info being invalid !", serviceModule.getErrors().contains("Test error message"));
  }
Verify stack resolution for single sign-on details

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/stack/ServiceModuleTest.java