@Test
  public void testDeserialize_onlyServices() throws Exception {
    AddServiceRequest request = mapper.readValue(REQUEST_MINIMAL_SERVICES_ONLY, AddServiceRequest.class);

    // filled-out values
    assertEquals(
      ImmutableSet.of(Service.of("STORM"), Service.of("BEACON")),
      request.getServices());

    // default / empty values
    assertEquals(ADD_SERVICE, request.getOperationType());
    assertEquals(ConfigRecommendationStrategy.defaultForAddService(), request.getRecommendationStrategy());
    assertEquals(INSTALL_AND_START, request.getProvisionAction());
    assertNull(request.getStackName());
    assertNull(request.getStackVersion());

    Configuration configuration = request.getConfiguration();
    assertTrue(configuration.getFullAttributes().isEmpty());
    assertTrue(configuration.getFullProperties().isEmpty());

    assertTrue(request.getComponents().isEmpty());
  }
Tests for {@link AddServiceRequest} serialization / deserialization / syntax validation
ambari-server/src/test/java/org/apache/ambari/server/topology/addservice/AddServiceRequestTest.java