- logger.info("setUp: exit");
- }
-
- @Test
- public void testGetActionEntitybyName(){
- controller.getActionEntitybyName(response);
- try {
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("actionPolicyDictionaryDatas"));
- } catch (Exception e) {
- fail();
- logger.error(e.getMessage(),e);
- }
- }
-
- @Test
- public void testGetActionPolicyDictionaryEntityData(){
- controller.getActionPolicyDictionaryEntityData(response);
- try {
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("actionPolicyDictionaryDatas"));
- } catch (Exception e) {
- fail();
- logger.error(e.getMessage(),e);
- }
- }
-
- @Test
- public void testSaveActionPolicyDictionary(){
- jsonString = "{\"actionPolicyDictionaryData\":{\"attributeName\":\"Test\",\"body\":\"{}\",\"description\":\"test\",\"headers\":[{\"$$hashKey\":\"object:548\",\"id\":\"choice1\",\"number\":\"12\",\"option\":\"test\"}],\"method\":\"GET\",\"type\":\"REST\",\"url\":\"http://test.com\"},\"userid\":\"demo\"}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.saveActionPolicyDictionary(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("actionPolicyDictionaryData"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testUpdateActionPolicyDictionary(){
- jsonString = "{\"actionPolicyDictionaryData\":{\"id\":1,\"attributeName\":\"Test\",\"body\":\"{}\",\"description\":\"test\",\"headers\":[{\"$$hashKey\":\"object:548\",\"id\":\"choice1\",\"number\":\"12\",\"option\":\"test\"}],\"method\":\"GET\",\"type\":\"REST\",\"url\":\"http://test.com\"},\"userid\":\"demo\"}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.saveActionPolicyDictionary(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("actionPolicyDictionaryData"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testRemoveActionPolicyDictionary(){
- jsonString = "{\"data\":{\"$$hashKey\":\"uiGrid-003S\",\"attributeName\":\"Test\",\"body\":\"{}\",\"createdDate\":1518195117000,\"description\":\"test\",\"header\":\"test=12\",\"id\":1,\"method\":\"GET\",\"modifiedDate\":1518195489000,\"type\":\"REST\",\"url\":\"http://test.com\",\"userCreatedBy\":{\"userLoginId\":\"demo\",\"userName\":\"Demo\"},\"userModifiedBy\":{\"userLoginId\":\"demo\",\"userName\":\"Demo\"}}}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.removeActionPolicyDictionary(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("actionPolicyDictionaryDatas"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
+ logger.info("setUp: exit");
+ }
+
+ @Test
+ public void testGetActionEntitybyName() {
+ controller.getActionEntitybyName(response);
+ try {
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("actionPolicyDictionaryDatas"));
+ } catch (Exception e) {
+ fail();
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ @Test
+ public void testGetActionPolicyDictionaryEntityData() {
+ controller.getActionPolicyDictionaryEntityData(response);
+ try {
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("actionPolicyDictionaryDatas"));
+ } catch (Exception e) {
+ fail();
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ @Test
+ public void testSaveActionPolicyDictionary() {
+ jsonString =
+ "{\"actionPolicyDictionaryData\":{\"attributeName\":\"Test\",\"body\":\"{}\",\"description\":"
+ + "\"test\",\"headers\":[{\"$$hashKey\":\"object:548\",\"id\":\"choice1\",\"number\":\"12\","
+ + "\"option\":\"test\"}],\"method\":\"GET\",\"type\":\"REST\",\"url\":\"http://test.com\"},"
+ + "\"userid\":\"demo\"}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.saveActionPolicyDictionary(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("actionPolicyDictionaryData"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testUpdateActionPolicyDictionary() {
+ jsonString =
+ "{\"actionPolicyDictionaryData\":{\"id\":1,\"attributeName\":\"Test\",\"body\":\"{}\",\"description\":"
+ + "\"test\",\"headers\":[{\"$$hashKey\":\"object:548\",\"id\":\"choice1\",\"number\":"
+ + "\"12\",\"option\":\"test\"}],\"method\":\"GET\",\"type\":\"REST\",\"url\":\"http://test.com\"},"
+ + "\"userid\":\"demo\"}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.saveActionPolicyDictionary(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("actionPolicyDictionaryData"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testRemoveActionPolicyDictionary() {
+ jsonString =
+ "{\"data\":{\"$$hashKey\":\"uiGrid-003S\",\"attributeName\":\"Test\",\"body\":\"{}\",\"createdDate\":"
+ + "1518195117000,\"description\":\"test\",\"header\":\"test=12\",\"id\":1,\"method\":\"GET\","
+ + "\"modifiedDate\":1518195489000,\"type\":\"REST\",\"url\":\"http://test.com\",\"userCreatedBy\":"
+ + "{\"userLoginId\":\"demo\",\"userName\":\"Demo\"},\"userModifiedBy\":{\"userLoginId\":\"demo\","
+ + "\"userName\":\"Demo\"}}}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.removeActionPolicyDictionary(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("actionPolicyDictionaryDatas"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }