问题是我的查询像:
/pc/odata/api/devices?$top=3000&$skip=0&$format=json&$expand=groups&$select=ID,Name,PrimaryIPAddress,groups/GroupPathLocation&$filter=((groups/Name%20eq%20'OI%20Inventory%20Group'))&timeout=120
不能用于
的存根HTTP错误500
访问/ __ files / pc / odata / api / devices的问题。 原因:
查询索引138中的非法字符: / not-matched?$ top = 3000&$ skip = 0&$ format = json&$ expand = groups&$ select = ID,Name,PrimaryIPAddress,groups / GroupPathLocation&$ filter =((groups / Name eq'OI库存组'))&timeout = 120
该请求有效,并且该应用可与不带参数的相同查询一起使用。
存根方法:
public void initialize( Integer D_ITEM_COUNT ) {
writedItemsFile( D_ITEM_COUNT );
ClasspathFileSource responseFiles = new ClasspathFileSource( "." );
dItemService = new WireMockServer( WireMockConfiguration.wireMockConfig()
.port( D_ITEMS_SERVICE_PORT )
.fileSource( responseFiles )
.enableBrowserProxying( false )
.notifier( new ConsoleNotifier( true ) ) );
dItemService.givenThat( get( urlEqualTo( D_D_ITEMS_SERVICE_ENDPOINT ) ).
willReturn( WireMock.aResponse()
.withHeader("Content-Type", "application/json")
.withBodyFile( "../" + D_ITEMS_SERVICE_RESPONSE_FILE + FILE_EXTENSION )
.withStatus( HttpStatus.SC_OK ) ) );
}