@Test
public void testProvide() throws Exception {

    Cluster cluster1 = createDummyCluster(1L, "cluster1");
    Cluster cluster2 = createDummyCluster(2L, "cluster2");
    Cluster cluster3 = createDummyCluster(3L, "cluster3");
    List<NamespaceServiceClusterMap> testServiceClusterMappings = createDummyServiceClusterMappings(
            Lists.newArrayList(cluster1, cluster2, cluster3));
    new Expectations() {{
        environmentService.getCluster(1L);
        result = cluster1;
        environmentService.getCluster(2L);
        result = cluster2;
        environmentService.getCluster(3L);
        result = cluster3;
        environmentService.listServiceClusterMapping(TEST_NAMESPACE_ID, TEST_SERVICE_NAME);
        result = testServiceClusterMappings;
    }};
    Namespace namespace = new Namespace();
    namespace.setId(TEST_NAMESPACE_ID);
    Map<Long, ComponentBundleHintProvider.BundleHintsResponse> hints = provider.provide(namespace, null, null);
    Assert.assertEquals(3, hints.size());
    Assert.assertEquals(cluster1, hints.get(cluster1.getId()).getCluster());
    Assert.assertEquals(TEST_HINTS, hints.get(cluster1.getId()).getHints());
    Assert.assertEquals(cluster2, hints.get(cluster2.getId()).getCluster());
    Assert.assertEquals(TEST_HINTS, hints.get(cluster2.getId()).getHints());
    Assert.assertEquals(cluster3, hints.get(cluster3.getId()).getCluster());
    Assert.assertEquals(TEST_HINTS, hints.get(cluster3.getId()).getHints());
}