### Question:
DirectPromethuesQueryHandler extends CounterMetricHandler { @Override public float getCounterMerticValue(CounterDetailVO counterDetails, List<CounterDetailVO> listCounterDetails) throws Exception { return getMetricValue(counterDetails); }  @Override float getCounterMerticValue(CounterDetailVO counterDetails, List<CounterDetailVO> listCounterDetails); @Override Logger getLogger();  }### Answer:
@Test() public void testGetCounterMerticValue(){ MockUp<RestCommunicationHandler> rch = new MockUp<com.tmobile.kardio.surveiller.main.RestCommunicationHandler>() { @Mock public String getResponse(String urlStr, Boolean doAuth,String authType, String encodedAuth){ return mcData.mockSingleVauleJson(); } }; DirectPromethuesQueryHandler ss = new DirectPromethuesQueryHandler(); try { ss.getCounterMerticValue(mcData.getMockedCounterDetails(), null); } catch (Exception e) { e.printStackTrace(); } rch.tearDown(); rch = new MockUp<com.tmobile.kardio.surveiller.main.RestCommunicationHandler>() { @Mock public String getResponse(String urlStr, Boolean doAuth, String authType, String encodedAuth){ return mcData.mockValueNodeEmptyPromJson(); } }; boolean thrown = false; try { ss.getCounterMerticValue(mcData.getMockedCounterDetails(), null); } catch (Exception e) { thrown = true; } assertTrue(thrown); rch.tearDown(); rch = new MockUp<com.tmobile.kardio.surveiller.main.RestCommunicationHandler>() { @Mock public String getResponse(String urlStr, Boolean doAuth, String authType, String encodedAuth){ String jsonString = mcData.mockDataNodeEmptyPromJson(); return jsonString; } }; boolean emptyDataException = false; try { ss.getCounterMerticValue(mcData.getMockedCounterDetails(), null); } catch (Exception e) { emptyDataException = true; } assertTrue(emptyDataException); rch.tearDown(); rch = new MockUp<com.tmobile.kardio.surveiller.main.RestCommunicationHandler>() { @Mock public String getResponse(String urlStr, Boolean doAuth, String authType, String encodedAuth){ return mcData.mockDataStatusFailedPromJson(); } }; boolean statusFailedException = false; try { ss.getCounterMerticValue(mcData.getMockedCounterDetails(), null); } catch (Exception e) { statusFailedException = true; } assertTrue(statusFailedException); rch.tearDown(); rch = new MockUp<com.tmobile.kardio.surveiller.main.RestCommunicationHandler>() { @Mock public String getResponse(String urlStr, Boolean doAuth, String authType, String encodedAuth){ return mcData.mockDataNodeNullPromJson(); } }; boolean resultEmptyException = false; try { ss.getCounterMerticValue(mcData.getMockedCounterDetails(), null); } catch (Exception e) { resultEmptyException = true; } assertTrue(resultEmptyException); rch.tearDown(); rch = new MockUp<com.tmobile.kardio.surveiller.main.RestCommunicationHandler>() { @Mock public String getResponse(String urlStr, Boolean doAuth, String authType, String encodedAuth){ return mcData.mockStatusNullPromJson(); } }; boolean statusNullException = false; try { ss.getCounterMerticValue(mcData.getMockedCounterDetails(), null); } catch (Exception e) { statusNullException = true; } assertTrue(statusNullException); rch.tearDown(); }