* ============LICENSE_START=======================================================
* ONAP-PAP-REST
* ================================================================================
* ============LICENSE_START=======================================================
* ONAP-PAP-REST
* ================================================================================
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.doNothing;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.doNothing;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.rest.dao.CommonClassDao;
import org.onap.policy.rest.jpa.DCAEuuid;
import org.onap.policy.rest.jpa.MicroServiceLocation;
import org.onap.policy.rest.dao.CommonClassDao;
import org.onap.policy.rest.jpa.DCAEuuid;
import org.onap.policy.rest.jpa.MicroServiceLocation;
br = new BufferedReader(new StringReader(jsonString));
//--- mock the getReader() call
when(request.getReader()).thenReturn(br);
br = new BufferedReader(new StringReader(jsonString));
//--- mock the getReader() call
when(request.getReader()).thenReturn(br);
- @After
- public void tearDown() throws Exception {
- }
-
-
- @Test
- public void testGetUserInfo() {
-
- logger.info("testGetUserInfo: Entering");
-
- UserInfo userInfo = controller.getUserInfo("testing");
- logger.info("userInfo.getUserName() : " + userInfo.getUserName());
-
- assertEquals("John", userInfo.getUserName());
-
- logger.info("testGetUserInfo: exit");
- }
when(request.getReader()).thenReturn(br);
controller.removeMicroServiceConfigNameDictionary(request, response);
logger.info("response.getContentAsString(): " + response.getContentAsString());
when(request.getReader()).thenReturn(br);
controller.removeMicroServiceConfigNameDictionary(request, response);
logger.info("response.getContentAsString(): " + response.getContentAsString());
logger.info("response.getContentAsString(): " + response.getContentAsString());
} catch (UnsupportedEncodingException e) {
fail("Exception: " + e);
logger.info("response.getContentAsString(): " + response.getContentAsString());
} catch (UnsupportedEncodingException e) {
fail("Exception: " + e);
logger.info("response.getContentAsString(): " + response.getContentAsString());
} catch (UnsupportedEncodingException e) {
fail("Exception: " + e);
logger.info("response.getContentAsString(): " + response.getContentAsString());
} catch (UnsupportedEncodingException e) {
fail("Exception: " + e);
- jsonString = "{\"microServiceCongigNameDictionaryData\": {\"modelName\": \"test\", \"inprocess\": false,\"model\": {\"name\": \"testingdata\", "
+ jsonString = "{\"microServiceConfigNameDictionaryData\": {\"modelName\": \"test\", \"inprocess\": false,\"model\": {\"name\": \"testingdata\", "
+ " \"subScopename\": \"\",\"path\": [],\"type\": \"dir\",\"size\": 0,\"date\": \"2017-04-12T21:26:57.000Z\", "
+ " \"version\": \"\",\"createdBy\": \"someone\", \"modifiedBy\": \"someone\", \"content\": \"\",\"recursive\": false},"
+ " \"tempModel\": {\"name\": \"testingdata\",\"subScopename\": \"\" },"
+ " \"subScopename\": \"\",\"path\": [],\"type\": \"dir\",\"size\": 0,\"date\": \"2017-04-12T21:26:57.000Z\", "
+ " \"version\": \"\",\"createdBy\": \"someone\", \"modifiedBy\": \"someone\", \"content\": \"\",\"recursive\": false},"
+ " \"tempModel\": {\"name\": \"testingdata\",\"subScopename\": \"\" },"
when(request.getReader()).thenReturn(br);
controller.saveMicroServiceConfigNameDictionary(request, response);
logger.info("response.getContentAsString(): " + response.getContentAsString());
when(request.getReader()).thenReturn(br);
controller.saveMicroServiceConfigNameDictionary(request, response);
logger.info("response.getContentAsString(): " + response.getContentAsString());
when(request.getReader()).thenReturn(br);
controller.removeMicroServiceConfigNameDictionary(request, response);
logger.info("response.getContentAsString(): " + response.getContentAsString());
when(request.getReader()).thenReturn(br);
controller.removeMicroServiceConfigNameDictionary(request, response);
logger.info("response.getContentAsString(): " + response.getContentAsString());
logger.info("response.getContentAsString(): " + response.getContentAsString());
assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("microServiceModelsDictionaryDatas"));
logger.info("response.getContentAsString(): " + response.getContentAsString());
assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("microServiceModelsDictionaryDatas"));
logger.info("response.getContentAsString(): " + response.getContentAsString());
assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("microServiceModelsDictionaryDatas"));
logger.info("response.getContentAsString(): " + response.getContentAsString());
assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("microServiceModelsDictionaryDatas"));
logger.info("response.getContentAsString(): " + response.getContentAsString());
assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("microServiceModelsDictionaryClassDatas"));
logger.info("response.getContentAsString(): " + response.getContentAsString());
assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("microServiceModelsDictionaryClassDatas"));