public void ICanDeserializeJobSubmissionResultFromRawJson()
        {
            var converter = new PayloadConverter();
            var jobId     = converter.DeserializeJobSubmissionResponse(RawJobSubmissionResultsPayload);

            Assert.AreEqual("job_001", jobId);
        }
        public void ICanDeserializeJobSubmissionResultFromJsonWithErrorMessage()
        {
            var converter = new PayloadConverter();

            try
            {
                converter.DeserializeJobSubmissionResponse(RawJobSubmissionResultsPayloadWithError);
            }
            catch (InvalidOperationException ex)
            {
                Assert.AreEqual("some error", ex.Message);
            }
        }
        /// <inheritdoc />
        public async Task <JobCreationResults> SubmitHiveJob(HiveJobCreateParameters details)
        {
            //NEIN: Any code modification here should add unit tests for this class
            var converter = new PayloadConverter();
            var payload   = converter.SerializeHiveRequest(this.credentials.UserName, details);
            var client    = ServiceLocator.Instance.Locate <IHadoopRemoteJobSubmissionRestClientFactory>().Create(this.credentials, this.context, this.ignoreSslErrors, this.GetUserAgentString());
            var result    = await client.SubmitHiveJob(payload);

            return(new JobCreationResults()
            {
                JobId = converter.DeserializeJobSubmissionResponse(result.Content)
            });
        }
        public void ICanDeserializeJobSubmissionResultWithNonJsonObject()
        {
            var converter = new PayloadConverter();

            converter.DeserializeJobSubmissionResponse(EmptyJsonArray);
        }
        public void ICanDeserializeJobSubmissionResultWithBadJson()
        {
            var converter = new PayloadConverter();

            converter.DeserializeJobSubmissionResponse(BadJson);
        }
        public void ICanDeserializeJobSubmissionResultWithMissingId()
        {
            var converter = new PayloadConverter();

            converter.DeserializeJobSubmissionResponse(JobSubmissionResultsPayloadMissingIdAndError);
        }