@Test
public void testProcessMissingParamKeys() throws Exception {
- PropertyDefinitionNode propertyDefinitionNode = new PropertyDefinitionNode();
Map<String, String> inParams = new HashMap<String, String>();
inParams.put(ParamsHandlerConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
@Test(expected = SvcLogicException.class)
public void testInProcessMissingParamKeysForEmptyPdContent() throws Exception {
- PropertyDefinitionNode propertyDefinitionNode = new PropertyDefinitionNode();
Map<String, String> inParams = new HashMap<String, String>();
inParams.put(ParamsHandlerConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
String jsonData = IOUtils.toString(
@Test
public void testProcessExternalSystemParamKeys() throws Exception {
- PropertyDefinitionNode propertyDefinitionNode = new PropertyDefinitionNode();
Map<String, String> inParams = new HashMap<String, String>();
inParams.put(ParamsHandlerConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
@Test
public void mergeJsonData() throws Exception {
- PropertyDefinitionNode propertyDefinitionNode = new PropertyDefinitionNode();
Map<String, String> inParams = new HashMap<String, String>();
inParams.put(ParamsHandlerConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
@Test
public void mergeJsonDataForEmptyParams() throws SvcLogicException, IOException {
- PropertyDefinitionNode propertyDefinitionNode = new PropertyDefinitionNode();
Map<String, String> inParams = new HashMap<String, String>();
inParams.put(ParamsHandlerConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
String mergeJsonData = IOUtils.toString(
@Test
public void testValidationPd() throws Exception {
- PropertyDefinitionNode propertyDefinitionNode = new PropertyDefinitionNode();
Map<String, String> inParams = new HashMap<String, String>();
SvcLogicContext ctx = new SvcLogicContext();
String jsonData = IOUtils.toString(
inParams.put(ParamsHandlerConstant.INPUT_PARAM_SYSTEM_NAME, "INSTAR");
propertyDefinitionNode.validateParams(inParams, ctx);
}
+
+ @Test(expected=SvcLogicException.class)
+ public void testValidateParamsForEmptyParams() throws Exception
+ {
+ Map<String, String> inParams = new HashMap<String, String>();
+ SvcLogicContext ctx = new SvcLogicContext();
+ propertyDefinitionNode.validateParams(inParams, ctx);
+ }
+
+ @Test
+ public void testValidateParamsForEmptyConfigParams() throws Exception
+ {
+ Map<String, String> inParams = new HashMap<String, String>();
+ String jsonData = IOUtils.toString(
+ TestPropertyDefinitionNode.class.getClassLoader().getResourceAsStream("parser/pd.yaml"),
+ Charset.defaultCharset());
+ inParams.put(ParamsHandlerConstant.INPUT_PARAM_PD_CONTENT, jsonData);
+ SvcLogicContext ctx = new SvcLogicContext();
+ propertyDefinitionNode.validateParams(inParams, ctx);
+ String status = ctx.getAttribute("status");
+ assertEquals(ParamsHandlerConstant.OUTPUT_STATUS_SUCCESS,status);
+ }
}