@Test
  public void testsShouldConfigureClusterTaskExecuteWhenCalledFromAsyncCallableService() throws Exception {
    // GIVEN
    expect(clusterConfigurationRequest.getRequiredHostGroups()).andReturn(Collections.emptyList());
    expect(clusterTopology.getHostGroupInfo()).andReturn(Collections.emptyMap());
    expect(clusterTopology.getClusterId()).andReturn(1L).anyTimes();
    expect(clusterTopology.getAmbariContext()).andReturn(ambariContext);
    expect(ambariContext.getClusterName(1L)).andReturn("testCluster");
    clusterConfigurationRequest.process();
    replayAll();

    AsyncCallableService<Boolean> asyncService = new AsyncCallableService<>(testSubject, 5000, 500, "test", t -> {});

    // WHEN
    asyncService.call();

    // THEN
    verifyAll();
  }
Unit test for the ConfigureClusterTask class.
As business methods of this class don't return values, the assertions are made by verifying method calls on mocks.
Thus having strict mocks is essential!
ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigureClusterTaskTest.java