示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Ignore @Test public void testHistoryServiceEngineAccess_HistoricDetailBinaryFile()
        public virtual void testHistoryServiceEngineAccess_HistoricDetailBinaryFile()
        {
            HistoricDetailQuery    query    = mock(typeof(HistoricDetailQuery));
            HistoricVariableUpdate instance = mock(typeof(HistoricVariableUpdate));
            string filename = "test.txt";

            sbyte[]   byteContent   = "test".GetBytes();
            string    encoding      = "UTF-8";
            FileValue variableValue = Variables.fileValue(filename).file(byteContent).mimeType(ContentType.TEXT.ToString()).encoding(encoding).create();

            when(instance.TypedValue).thenReturn(variableValue);
            when(query.singleResult()).thenReturn(instance);
            when(mockHistoryService.createHistoricDetailQuery()).thenReturn(query);

            given().pathParam("name", EXAMPLE_ENGINE_NAME).then().expect().statusCode(Status.OK.StatusCode).body(@is(equalTo(StringHelper.NewString(byteContent)))).and().header("Content-Disposition", "attachment; filename=" + filename).contentType(CoreMatchers.either <string>(equalTo(ContentType.TEXT.ToString() + ";charset=UTF-8")).or(equalTo(ContentType.TEXT.ToString() + " ;charset=UTF-8"))).when().get(HISTORY_BINARY_DETAIL_URL);

            verify(mockHistoryService).createHistoricDetailQuery();
            verifyZeroInteractions(processEngine);
        }