Repository: incubator-atlas Updated Branches: refs/heads/master 89f706096 -> 19a5f65c9
ATLAS-1436: test fix to address NPE Signed-off-by: Madhan Neethiraj <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/19a5f65c Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/19a5f65c Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/19a5f65c Branch: refs/heads/master Commit: 19a5f65c9bcafc77df164c4dd75c89782b4f4076 Parents: 89f7060 Author: apoorvnaik <[email protected]> Authored: Thu Jan 26 14:01:14 2017 -0800 Committer: Madhan Neethiraj <[email protected]> Committed: Thu Jan 26 14:12:57 2017 -0800 ---------------------------------------------------------------------- .../atlas/services/MetricsServiceTest.java | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/19a5f65c/repository/src/test/java/org/apache/atlas/services/MetricsServiceTest.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/services/MetricsServiceTest.java b/repository/src/test/java/org/apache/atlas/services/MetricsServiceTest.java index 5d2e460..bb8c223 100644 --- a/repository/src/test/java/org/apache/atlas/services/MetricsServiceTest.java +++ b/repository/src/test/java/org/apache/atlas/services/MetricsServiceTest.java @@ -1,3 +1,20 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.atlas.services; import org.apache.atlas.model.metrics.AtlasMetrics; @@ -49,6 +66,17 @@ public class MetricsServiceTest { mockMapList.add(cMockMap); when(mockConfig.getInt(anyString(), anyInt())).thenReturn(5); + when(mockConfig.getString(anyString(), anyString())) + // we have seven count queries so stubbing 7 counts + .thenReturn("dummyTestQuery.count()") + .thenReturn("dummyTestQuery.count()") + .thenReturn("dummyTestQuery.count()") + .thenReturn("dummyTestQuery.count()") + .thenReturn("dummyTestQuery.count()") + .thenReturn("dummyTestQuery.count()") + .thenReturn("dummyTestQuery.count()") + // The last query is a map + .thenReturn("dummyTestQuery"); assertEquals(mockConfig.getInt("test", 1), 5); when(mockTypeRegistry.getAllEntityDefNames()).thenReturn(Arrays.asList("a", "b", "c")); setupMockGraph();
