### Question:
MsoCommonUtils { public <T> T executeAndRecordOpenstackRequest(OpenStackRequest<T> request) { return executeAndRecordOpenstackRequest(request, true); }  T executeAndRecordOpenstackRequest(OpenStackRequest<T> request); MsoException keystoneErrorToMsoException(OpenStackBaseException e, String context); boolean isNullOrEmpty(String s);  }### Answer:
@Test public final void testExecuteAndRecordOpenstackRequest() { Mockito.when(openstackRequest.endpoint()).thenReturn("localhost"); Mockito.when(openstackRequest.path()).thenReturn("/test"); assertNull(commonUtils.executeAndRecordOpenstackRequest(openstackRequest)); assertNull(commonUtils.executeAndRecordOpenstackRequest(openstackRequest, true)); }
@Test public void testexecuteAndRecordOpenstackRequestResponseException() { expectedException.expect(OpenStackResponseException.class); doThrow(OpenStackResponseException.class).when(openstackRequest).execute(); commonUtils.executeAndRecordOpenstackRequest(openstackRequest); commonUtils.executeAndRecordOpenstackRequest(openstackRequest, true); }
@Test public void testexecuteAndRecordOpenstackRequestConnectException() { expectedException.expect(OpenStackConnectException.class); doThrow(OpenStackConnectException.class).when(openstackRequest).execute(); commonUtils.executeAndRecordOpenstackRequest(openstackRequest, true); }