@Test public void executeTestSuccess() throws Exception { final Map<String, String> resultMap = authorizationToken.execute("53dd860e1b72ff0467030003", "pXeTVcmdbU9XxH6fPcPlq8Y9D9G3Cdo5Eh2nMSgKj/DWqeSFFXDdmpz5Trv+L2hQNM+nGa704Rf8Z22W9O1jdQ==", "08/04/2014 10:03 PM"); assertEquals(resultMap.get(RETURN_RESULT), "SharedAccessSignature uid=53dd860e1b72ff0467030003&ex=2014-08-04T22:03:00.0000000Z&sn=FWBrF2PBYVEZgpoyaPWNKIBIGLQxbJAw6A3Lu4EB78aooaZldHXZTZBkqyMWlLdrpK5/q3BFDgj9vqX1vrR0ww=="); assertEquals(resultMap.get(RETURN_CODE), SUCCESS); }
@Action(name = "Get shared access key token for Azure", outputs = { @Output(RETURN_RESULT), @Output(RETURN_CODE), @Output(EXCEPTION) }, responses = { @Response(text = SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = COMPARE_EQUAL, responseType = RESOLVED), @Response(text = FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = COMPARE_EQUAL, responseType = ERROR) }) public Map<String, String> execute(@Param(value = IDENTIFIER, required = true) final String identifier, @Param(value = PRIMARY_OR_SECONDARY_KEY, required = true) final String primaryOrSecondaryKey, @Param(value = EXPIRY, required = true) final String expiry) { final List<String> exceptionMessages = InputsValidation.verifySharedAccessInputs(identifier, primaryOrSecondaryKey, expiry); if (!exceptionMessages.isEmpty()) { final String errorMessage = StringUtilities.join(exceptionMessages, System.lineSeparator()); return getFailureResultsMap(errorMessage); } try { final Date expiryDate = DateUtilities.parseDate(expiry.trim()); return getSuccessResultsMap(getToken(identifier.trim(), primaryOrSecondaryKey.trim(), expiryDate)); } catch (Exception exception) { return getFailureResultsMap(exception); } }
GetSharedAccessKeyToken { @Action(name = "Get shared access key token for Azure", outputs = { @Output(RETURN_RESULT), @Output(RETURN_CODE), @Output(EXCEPTION) }, responses = { @Response(text = SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = COMPARE_EQUAL, responseType = RESOLVED), @Response(text = FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = COMPARE_EQUAL, responseType = ERROR) }) public Map<String, String> execute(@Param(value = IDENTIFIER, required = true) final String identifier, @Param(value = PRIMARY_OR_SECONDARY_KEY, required = true) final String primaryOrSecondaryKey, @Param(value = EXPIRY, required = true) final String expiry) { final List<String> exceptionMessages = InputsValidation.verifySharedAccessInputs(identifier, primaryOrSecondaryKey, expiry); if (!exceptionMessages.isEmpty()) { final String errorMessage = StringUtilities.join(exceptionMessages, System.lineSeparator()); return getFailureResultsMap(errorMessage); } try { final Date expiryDate = DateUtilities.parseDate(expiry.trim()); return getSuccessResultsMap(getToken(identifier.trim(), primaryOrSecondaryKey.trim(), expiryDate)); } catch (Exception exception) { return getFailureResultsMap(exception); } } }
GetSharedAccessKeyToken { @Action(name = "Get shared access key token for Azure", outputs = { @Output(RETURN_RESULT), @Output(RETURN_CODE), @Output(EXCEPTION) }, responses = { @Response(text = SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = COMPARE_EQUAL, responseType = RESOLVED), @Response(text = FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = COMPARE_EQUAL, responseType = ERROR) }) public Map<String, String> execute(@Param(value = IDENTIFIER, required = true) final String identifier, @Param(value = PRIMARY_OR_SECONDARY_KEY, required = true) final String primaryOrSecondaryKey, @Param(value = EXPIRY, required = true) final String expiry) { final List<String> exceptionMessages = InputsValidation.verifySharedAccessInputs(identifier, primaryOrSecondaryKey, expiry); if (!exceptionMessages.isEmpty()) { final String errorMessage = StringUtilities.join(exceptionMessages, System.lineSeparator()); return getFailureResultsMap(errorMessage); } try { final Date expiryDate = DateUtilities.parseDate(expiry.trim()); return getSuccessResultsMap(getToken(identifier.trim(), primaryOrSecondaryKey.trim(), expiryDate)); } catch (Exception exception) { return getFailureResultsMap(exception); } }  }
GetSharedAccessKeyToken { @Action(name = "Get shared access key token for Azure", outputs = { @Output(RETURN_RESULT), @Output(RETURN_CODE), @Output(EXCEPTION) }, responses = { @Response(text = SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = COMPARE_EQUAL, responseType = RESOLVED), @Response(text = FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = COMPARE_EQUAL, responseType = ERROR) }) public Map<String, String> execute(@Param(value = IDENTIFIER, required = true) final String identifier, @Param(value = PRIMARY_OR_SECONDARY_KEY, required = true) final String primaryOrSecondaryKey, @Param(value = EXPIRY, required = true) final String expiry) { final List<String> exceptionMessages = InputsValidation.verifySharedAccessInputs(identifier, primaryOrSecondaryKey, expiry); if (!exceptionMessages.isEmpty()) { final String errorMessage = StringUtilities.join(exceptionMessages, System.lineSeparator()); return getFailureResultsMap(errorMessage); } try { final Date expiryDate = DateUtilities.parseDate(expiry.trim()); return getSuccessResultsMap(getToken(identifier.trim(), primaryOrSecondaryKey.trim(), expiryDate)); } catch (Exception exception) { return getFailureResultsMap(exception); } }  @Action(name = "Get shared access key token for Azure", outputs = { @Output(RETURN_RESULT), @Output(RETURN_CODE), @Output(EXCEPTION) }, responses = { @Response(text = SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = COMPARE_EQUAL, responseType = RESOLVED), @Response(text = FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = COMPARE_EQUAL, responseType = ERROR) }) Map<String, String> execute(@Param(value = IDENTIFIER, required = true) final String identifier,
                                       @Param(value = PRIMARY_OR_SECONDARY_KEY, required = true) final String primaryOrSecondaryKey,
                                       @Param(value = EXPIRY, required = true) final String expiry); }
GetSharedAccessKeyToken { @Action(name = "Get shared access key token for Azure", outputs = { @Output(RETURN_RESULT), @Output(RETURN_CODE), @Output(EXCEPTION) }, responses = { @Response(text = SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = COMPARE_EQUAL, responseType = RESOLVED), @Response(text = FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = COMPARE_EQUAL, responseType = ERROR) }) public Map<String, String> execute(@Param(value = IDENTIFIER, required = true) final String identifier, @Param(value = PRIMARY_OR_SECONDARY_KEY, required = true) final String primaryOrSecondaryKey, @Param(value = EXPIRY, required = true) final String expiry) { final List<String> exceptionMessages = InputsValidation.verifySharedAccessInputs(identifier, primaryOrSecondaryKey, expiry); if (!exceptionMessages.isEmpty()) { final String errorMessage = StringUtilities.join(exceptionMessages, System.lineSeparator()); return getFailureResultsMap(errorMessage); } try { final Date expiryDate = DateUtilities.parseDate(expiry.trim()); return getSuccessResultsMap(getToken(identifier.trim(), primaryOrSecondaryKey.trim(), expiryDate)); } catch (Exception exception) { return getFailureResultsMap(exception); } }  @Action(name = "Get shared access key token for Azure", outputs = { @Output(RETURN_RESULT), @Output(RETURN_CODE), @Output(EXCEPTION) }, responses = { @Response(text = SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = COMPARE_EQUAL, responseType = RESOLVED), @Response(text = FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = COMPARE_EQUAL, responseType = ERROR) }) Map<String, String> execute(@Param(value = IDENTIFIER, required = true) final String identifier,
                                       @Param(value = PRIMARY_OR_SECONDARY_KEY, required = true) final String primaryOrSecondaryKey,
                                       @Param(value = EXPIRY, required = true) final String expiry);  }