- logger.info("setUp: exit");
- }
-
- @Test
- public void testGetVSCLActionDictionaryByNameEntityData(){
- when(commonClassDao.getDataByColumn(VSCLAction.class, "vsclaction")).thenReturn(data);
- controller.getVSCLActionDictionaryByNameEntityData(response);
- try {
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vsclActionDictionaryDatas"));
- } catch (Exception e) {
- fail();
- logger.error(e.getMessage(),e);
- }
- }
-
- @Test
- public void testGetVSCLActionDictionaryEntityData(){
- when(commonClassDao.getData(VSCLAction.class)).thenReturn(new ArrayList<>());
- controller.getVSCLActionDictionaryEntityData(response);
- try {
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vsclActionDictionaryDatas"));
- } catch (Exception e) {
- fail();
- logger.error(e.getMessage(),e);
- }
- }
-
- @Test
- public void testGetVNFTypeDictionaryByNameEntityData(){
- when(commonClassDao.getDataByColumn(VNFType.class, "vnftype")).thenReturn(data);
- controller.getVNFTypeDictionaryByNameEntityData(response);
- try {
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vnfTypeDictionaryDatas"));
- } catch (Exception e) {
- fail();
- logger.error(e.getMessage(),e);
- }
- }
-
- @Test
- public void testGetVNFTypeDictionaryEntityData(){
- when(commonClassDao.getData(VNFType.class)).thenReturn(new ArrayList<>());
- controller.getVNFTypeDictionaryEntityData(response);
- try {
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vnfTypeDictionaryDatas"));
- } catch (Exception e) {
- fail();
- logger.error(e.getMessage(),e);
- }
- }
-
- @Test
- public void testGetPEPOptionsDictionaryByNameEntityData(){
- when(commonClassDao.getDataByColumn(PEPOptions.class, "pepName")).thenReturn(data);
- controller.getPEPOptionsDictionaryByNameEntityData(response);
- try {
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("pepOptionsDictionaryDatas"));
- } catch (Exception e) {
- fail();
- logger.error(e.getMessage(),e);
- }
- }
-
- @Test
- public void testGetPEPOptionsDictionaryEntityData(){
- when(commonClassDao.getData(PEPOptions.class)).thenReturn(new ArrayList<>());
- controller.getPEPOptionsDictionaryEntityData(response);
- try {
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("pepOptionsDictionaryDatas"));
- } catch (Exception e) {
- fail();
- logger.error(e.getMessage(),e);
- }
- }
-
- @Test
- public void testGetVarbindDictionaryByNameEntityData(){
- when(commonClassDao.getDataByColumn(VarbindDictionary.class, "varbindName")).thenReturn(data);
- controller.getVarbindDictionaryByNameEntityData(response);
- try {
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("varbindDictionaryDatas"));
- } catch (Exception e) {
- fail();
- logger.error(e.getMessage(),e);
- }
- }
-
- @Test
- public void testGetVarbindDictionaryEntityData(){
- when(commonClassDao.getData(VarbindDictionary.class)).thenReturn(new ArrayList<>());
- controller.getVarbindDictionaryEntityData(response);
- try {
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("varbindDictionaryDatas"));
- } catch (Exception e) {
- fail();
- logger.error(e.getMessage(),e);
- }
- }
-
- @Test
- public void testGetClosedLoopServiceDictionaryByNameEntityData(){
- when(commonClassDao.getDataByColumn(ClosedLoopD2Services.class, "serviceName")).thenReturn(data);
- controller.getClosedLoopServiceDictionaryByNameEntityData(response);
- try {
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopServiceDictionaryDatas"));
- } catch (Exception e) {
- fail();
- logger.error(e.getMessage(),e);
- }
- }
-
- @Test
- public void testGetClosedLoopServiceDictionaryEntityData(){
- when(commonClassDao.getData(ClosedLoopD2Services.class)).thenReturn(new ArrayList<>());
- controller.getClosedLoopServiceDictionaryEntityData(response);
- try {
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopServiceDictionaryDatas"));
- } catch (Exception e) {
- fail();
- logger.error(e.getMessage(),e);
- }
- }
-
- @Test
- public void testGetClosedLoopSiteDictionaryByNameEntityData(){
- when(commonClassDao.getDataByColumn(ClosedLoopSite.class, "siteName")).thenReturn(data);
- controller.getClosedLoopSiteDictionaryByNameEntityData(response);
- try {
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopSiteDictionaryDatas"));
- } catch (Exception e) {
- fail();
- logger.error(e.getMessage(),e);
- }
- }
-
- @Test
- public void testGetClosedLoopSiteDictionaryEntityData(){
- when(commonClassDao.getData(ClosedLoopSite.class)).thenReturn(new ArrayList<>());
- controller.getClosedLoopSiteDictionaryEntityData(response);
- try {
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopSiteDictionaryDatas"));
- } catch (Exception e) {
- fail();
- logger.error(e.getMessage(),e);
- }
- }
-
- @Test
- public void testSaveVSCLAction(){
- jsonString = "{\"userid\":\"demo\",\"vsclActionDictionaryData\":{\"description\":\"test\",\"vsclaction\":\"Test\"}}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.saveVSCLAction(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vsclActionDictionaryDatas"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testUpdateVSCLAction(){
- jsonString = "{\"userid\":\"demo\",\"vsclActionDictionaryData\":{\"id\":1,\"description\":\"test\",\"vsclaction\":\"Test\"}}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.saveVSCLAction(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vsclActionDictionaryDatas"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testRemoveVSCLAction(){
- jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"vsclaction\":\"Test\"}}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.removeVSCLAction(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vsclActionDictionaryDatas"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testSaveVnfType(){
- jsonString = "{\"userid\":\"demo\",\"vnfTypeDictionaryData\":{\"description\":\"test\",\"vnftype\":\"Test\"}}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.saveVnfType(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vnfTypeDictionaryData"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testUpdateVnfType(){
- jsonString = "{\"userid\":\"demo\",\"vnfTypeDictionaryData\":{\"id\":1,\"description\":\"test\",\"vnftype\":\"Test\"}}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.saveVnfType(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vnfTypeDictionaryData"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testRemoveVnfType(){
- jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"vnftype\":\"Test\"}}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.removeVnfType(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vnfTypeDictionaryData"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testSavePEPOptions(){
- jsonString = "{\"pepOptionsDictionaryData\":{\"attributes\":[{\"$$hashKey\":\"object:257\",\"id\":\"choice1\",\"number\":\"12\",\"option\":\"test\"}],\"description\":\"test\",\"pepName\":\"Test\"},\"userid\":\"demo\"}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.savePEPOptions(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("pepOptionsDictionaryDatas"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testUpdatePEPOptions(){
- jsonString = "{\"pepOptionsDictionaryData\":{\"attributes\":[{\"$$hashKey\":\"object:257\",\"id\":\"choice1\",\"number\":\"12\",\"option\":\"test\"}],\"description\":\"test\",\"pepName\":\"Test\",\"id\":1},\"userid\":\"demo\"}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.savePEPOptions(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("pepOptionsDictionaryDatas"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testRemovePEPOptions(){
- jsonString = "{\"data\":{\"attributes\":[{\"$$hashKey\":\"object:257\",\"id\":\"choice1\",\"number\":\"12\",\"option\":\"test\"}],\"description\":\"test\",\"pepName\":\"Test\"},\"userid\":\"demo\"}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.removePEPOptions(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("pepOptionsDictionaryDatas"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testSaveServiceType(){
- jsonString = "{\"userid\":\"demo\",\"closedLoopServiceDictionaryData\":{\"description\":\"test\",\"serviceName\":\"Test\",\"id\":1}}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.saveServiceType(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopServiceDictionaryData"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testUpdateServiceType(){
- jsonString = "{\"userid\":\"demo\",\"closedLoopServiceDictionaryData\":{\"id\":1,\"description\":\"test\",\"serviceName\":\"Test\"}}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.saveServiceType(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopServiceDictionaryData"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testRemoveServiceType(){
- jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"serviceName\":\"Test\"}}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.removeServiceType(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopServiceDictionaryData"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testSaveSiteType(){
- jsonString = "{\"userid\":\"demo\",\"closedLoopSiteDictionaryData\":{\"description\":\"test\",\"siteName\":\"Test\"}}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.saveSiteType(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopSiteDictionaryDatas"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testUpdateSiteType(){
- jsonString = "{\"userid\":\"demo\",\"closedLoopSiteDictionaryData\":{\"id\":1,\"description\":\"test\",\"siteName\":\"Test\"}}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.saveSiteType(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopSiteDictionaryDatas"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testRemoveSiteType(){
- jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"siteName\":\"Test\"}}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.removeSiteType(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopSiteDictionaryDatas"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testSaveVarbind(){
- jsonString = "{\"userid\":\"demo\",\"varbindDictionaryData\":{\"description\":\"test\",\"varbindName\":\"Test\"}}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.saveVarbind(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("varbindDictionaryDatas"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testUpdateVarbind(){
- jsonString = "{\"userid\":\"demo\",\"varbindDictionaryData\":{\"id\":1,\"description\":\"test\",\"varbindName\":\"Test\"}}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.saveVarbind(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("varbindDictionaryDatas"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
-
- @Test
- public void testRemoveVarbind(){
- jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"varbindName\":\"Test\"}}";
- try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
- when(request.getReader()).thenReturn(br);
- controller.removeVarbind(request, response);
- assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("varbindDictionaryDatas"));
- }catch(Exception e){
- logger.error("Exception"+ e);
- }
- }
+ logger.info("setUp: exit");
+ }
+
+ @Test
+ public void testGetVSCLActionDictionaryByNameEntityData() {
+ when(commonClassDao.getDataByColumn(VSCLAction.class, "vsclaction")).thenReturn(data);
+ controller.getVSCLActionDictionaryByNameEntityData(response);
+ try {
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("vsclActionDictionaryDatas"));
+ } catch (Exception e) {
+ fail();
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ @Test
+ public void testGetVSCLActionDictionaryEntityData() {
+ when(commonClassDao.getData(VSCLAction.class)).thenReturn(new ArrayList<>());
+ controller.getVSCLActionDictionaryEntityData(response);
+ try {
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("vsclActionDictionaryDatas"));
+ } catch (Exception e) {
+ fail();
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ @Test
+ public void testGetVNFTypeDictionaryByNameEntityData() {
+ when(commonClassDao.getDataByColumn(VNFType.class, "vnftype")).thenReturn(data);
+ controller.getVNFTypeDictionaryByNameEntityData(response);
+ try {
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("vnfTypeDictionaryDatas"));
+ } catch (Exception e) {
+ fail();
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ @Test
+ public void testGetVNFTypeDictionaryEntityData() {
+ when(commonClassDao.getData(VNFType.class)).thenReturn(new ArrayList<>());
+ controller.getVNFTypeDictionaryEntityData(response);
+ try {
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("vnfTypeDictionaryDatas"));
+ } catch (Exception e) {
+ fail();
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ @Test
+ public void testGetPEPOptionsDictionaryByNameEntityData() {
+ when(commonClassDao.getDataByColumn(PepOptions.class, "pepName")).thenReturn(data);
+ controller.getPEPOptionsDictionaryByNameEntityData(response);
+ try {
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("pepOptionsDictionaryDatas"));
+ } catch (Exception e) {
+ fail();
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ @Test
+ public void testGetPEPOptionsDictionaryEntityData() {
+ when(commonClassDao.getData(PepOptions.class)).thenReturn(new ArrayList<>());
+ controller.getPEPOptionsDictionaryEntityData(response);
+ try {
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("pepOptionsDictionaryDatas"));
+ } catch (Exception e) {
+ fail();
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ @Test
+ public void testGetVarbindDictionaryByNameEntityData() {
+ when(commonClassDao.getDataByColumn(VarbindDictionary.class, "varbindName")).thenReturn(data);
+ controller.getVarbindDictionaryByNameEntityData(response);
+ try {
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("varbindDictionaryDatas"));
+ } catch (Exception e) {
+ fail();
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ @Test
+ public void testGetVarbindDictionaryEntityData() {
+ when(commonClassDao.getData(VarbindDictionary.class)).thenReturn(new ArrayList<>());
+ controller.getVarbindDictionaryEntityData(response);
+ try {
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("varbindDictionaryDatas"));
+ } catch (Exception e) {
+ fail();
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ @Test
+ public void testGetClosedLoopServiceDictionaryByNameEntityData() {
+ when(commonClassDao.getDataByColumn(ClosedLoopD2Services.class, "serviceName")).thenReturn(data);
+ controller.getClosedLoopServiceDictionaryByNameEntityData(response);
+ try {
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("closedLoopServiceDictionaryDatas"));
+ } catch (Exception e) {
+ fail();
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ @Test
+ public void testGetClosedLoopServiceDictionaryEntityData() {
+ when(commonClassDao.getData(ClosedLoopD2Services.class)).thenReturn(new ArrayList<>());
+ controller.getClosedLoopServiceDictionaryEntityData(response);
+ try {
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("closedLoopServiceDictionaryDatas"));
+ } catch (Exception e) {
+ fail();
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ @Test
+ public void testGetClosedLoopSiteDictionaryByNameEntityData() {
+ when(commonClassDao.getDataByColumn(ClosedLoopSite.class, "siteName")).thenReturn(data);
+ controller.getClosedLoopSiteDictionaryByNameEntityData(response);
+ try {
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("closedLoopSiteDictionaryDatas"));
+ } catch (Exception e) {
+ fail();
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ @Test
+ public void testGetClosedLoopSiteDictionaryEntityData() {
+ when(commonClassDao.getData(ClosedLoopSite.class)).thenReturn(new ArrayList<>());
+ controller.getClosedLoopSiteDictionaryEntityData(response);
+ try {
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("closedLoopSiteDictionaryDatas"));
+ } catch (Exception e) {
+ fail();
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ @Test
+ public void testSaveVSCLAction() {
+ jsonString =
+ "{\"userid\":\"demo\",\"vsclActionDictionaryData\":{\"description\":\"test\",\"vsclaction\":\"Test\"}}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.saveVSCLAction(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("vsclActionDictionaryDatas"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testUpdateVSCLAction() {
+ jsonString =
+ "{\"userid\":\"demo\",\"vsclActionDictionaryData\":{\"id\":1,\"description\":\"test\",\"vsclaction\":\"Test\"}}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.saveVSCLAction(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("vsclActionDictionaryDatas"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testRemoveVSCLAction() {
+ jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"vsclaction\":\"Test\"}}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.removeVSCLAction(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("vsclActionDictionaryDatas"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testSaveVnfType() {
+ jsonString = "{\"userid\":\"demo\",\"vnfTypeDictionaryData\":{\"description\":\"test\",\"vnftype\":\"Test\"}}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.saveVnfType(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("vnfTypeDictionaryData"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testUpdateVnfType() {
+ jsonString =
+ "{\"userid\":\"demo\",\"vnfTypeDictionaryData\":{\"id\":1,\"description\":\"test\",\"vnftype\":\"Test\"}}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.saveVnfType(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("vnfTypeDictionaryData"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testRemoveVnfType() {
+ jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"vnftype\":\"Test\"}}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.removeVnfType(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("vnfTypeDictionaryData"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testSavePEPOptions() {
+ jsonString =
+ "{\"pepOptionsDictionaryData\":{\"attributes\":[{\"$$hashKey\":\"object:257\",\"id\":\"choice1\",\"number\":\"12\",\"option\":\"test\"}],\"description\":\"test\",\"pepName\":\"Test\"},\"userid\":\"demo\"}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.savePEPOptions(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("pepOptionsDictionaryDatas"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testUpdatePEPOptions() {
+ jsonString =
+ "{\"pepOptionsDictionaryData\":{\"attributes\":[{\"$$hashKey\":\"object:257\",\"id\":\"choice1\",\"number\":\"12\",\"option\":\"test\"}],\"description\":\"test\",\"pepName\":\"Test\",\"id\":1},\"userid\":\"demo\"}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.savePEPOptions(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("pepOptionsDictionaryDatas"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testRemovePEPOptions() {
+ jsonString =
+ "{\"data\":{\"attributes\":[{\"$$hashKey\":\"object:257\",\"id\":\"choice1\",\"number\":\"12\",\"option\":\"test\"}],\"description\":\"test\",\"pepName\":\"Test\"},\"userid\":\"demo\"}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.removePEPOptions(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("pepOptionsDictionaryDatas"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testSaveServiceType() {
+ jsonString =
+ "{\"userid\":\"demo\",\"closedLoopServiceDictionaryData\":{\"description\":\"test\",\"serviceName\":\"Test\",\"id\":1}}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.saveServiceType(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("closedLoopServiceDictionaryData"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testUpdateServiceType() {
+ jsonString =
+ "{\"userid\":\"demo\",\"closedLoopServiceDictionaryData\":{\"id\":1,\"description\":\"test\",\"serviceName\":\"Test\"}}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.saveServiceType(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("closedLoopServiceDictionaryData"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testRemoveServiceType() {
+ jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"serviceName\":\"Test\"}}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.removeServiceType(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("closedLoopServiceDictionaryData"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testSaveSiteType() {
+ jsonString =
+ "{\"userid\":\"demo\",\"closedLoopSiteDictionaryData\":{\"description\":\"test\",\"siteName\":\"Test\"}}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.saveSiteType(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("closedLoopSiteDictionaryDatas"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testUpdateSiteType() {
+ jsonString =
+ "{\"userid\":\"demo\",\"closedLoopSiteDictionaryData\":{\"id\":1,\"description\":\"test\",\"siteName\":\"Test\"}}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.saveSiteType(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("closedLoopSiteDictionaryDatas"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testRemoveSiteType() {
+ jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"siteName\":\"Test\"}}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.removeSiteType(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("closedLoopSiteDictionaryDatas"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testSaveVarbind() {
+ jsonString =
+ "{\"userid\":\"demo\",\"varbindDictionaryData\":{\"description\":\"test\",\"varbindName\":\"Test\"}}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.saveVarbind(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("varbindDictionaryDatas"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testUpdateVarbind() {
+ jsonString =
+ "{\"userid\":\"demo\",\"varbindDictionaryData\":{\"id\":1,\"description\":\"test\",\"varbindName\":\"Test\"}}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.saveVarbind(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("varbindDictionaryDatas"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }
+
+ @Test
+ public void testRemoveVarbind() {
+ jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"varbindName\":\"Test\"}}";
+ try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) {
+ when(request.getReader()).thenReturn(br);
+ controller.removeVarbind(request, response);
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("varbindDictionaryDatas"));
+ } catch (Exception e) {
+ logger.error("Exception" + e);
+ }
+ }