Commit 19a5f65c by apoorvnaik Committed by Madhan Neethiraj

ATLAS-1436: test fix to address NPE

parent 89f70609
/**
* 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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment