it works. But if I extract the random number calculation to a function, it returns 404:
Skipping {
"host": "oss.sonatype.org",
"path": "/content/repositories/releases/org/mock-server/mockserver-netty/5.10.0/mockserver-netty-5.10.0-jar-with-dependencies.jar",
"port": 443
} as file already downloaded
Running 'java -Dfile.encoding=UTF-8 -jar node_modules/mockserver-node/mockserver-netty-5.10.0-jar-with-dependencies.jar -serverPort 55555 -logLevel TRACE'
2020-04-02 10:09:41 io.netty.channel.MultithreadEventLoopGroup FINE -Dio.netty.eventLoopThreads: 16
2020-04-02 10:09:41 io.netty.util.internal.InternalThreadLocalMap FINE -Dio.netty.threadLocalMap.stringBuilder.initialSize: 1024
2020-04-02 10:09:41 io.netty.util.internal.InternalThreadLocalMap FINE -Dio.netty.threadLocalMap.stringBuilder.maxSize: 4096
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINE -Dio.netty.noKeySetOptimization: false
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINE -Dio.netty.selectorAutoRebuildThreshold: 512
2020-04-02 10:09:41 io.netty.util.internal.PlatformDependent FINE Platform: Windows
2020-04-02 10:09:41 io.netty.util.internal.PlatformDependent0 FINE -Dio.netty.noUnsafe: false
2020-04-02 10:09:41 io.netty.util.internal.PlatformDependent0 FINE Java version: 8
2020-04-02 10:09:41 io.netty.util.internal.PlatformDependent0 FINE sun.misc.Unsafe.theUnsafe: available
2020-04-02 10:09:41 io.netty.util.internal.PlatformDependent0 FINE sun.misc.Unsafe.copyMemory: available
2020-04-02 10:09:41 io.netty.util.internal.PlatformDependent0 FINE java.nio.Buffer.address: available
2020-04-02 10:09:41 io.netty.util.internal.PlatformDependent0 FINE direct buffer constructor: available
2020-04-02 10:09:41 io.netty.util.internal.PlatformDependent0 FINE java.nio.Bits.unaligned: available, true
2020-04-02 10:09:41 io.netty.util.internal.PlatformDependent0 FINE jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable prior to Java9
2020-04-02 10:09:41 io.netty.util.internal.PlatformDependent0 FINE java.nio.DirectByteBuffer.<init>(long, int): available
2020-04-02 10:09:41 io.netty.util.internal.PlatformDependent FINE sun.misc.Unsafe: available
2020-04-02 10:09:41 io.netty.util.internal.PlatformDependent FINE -Dio.netty.tmpdir: D:\Users\vgarcia\AppData\Local\Temp (java.io.tmpdir)
2020-04-02 10:09:41 io.netty.util.internal.PlatformDependent FINE -Dio.netty.bitMode: 64 (sun.arch.data.model)
2020-04-02 10:09:41 io.netty.util.internal.PlatformDependent FINE -Dio.netty.maxDirectMemory: 4772593664 bytes
2020-04-02 10:09:41 io.netty.util.internal.PlatformDependent FINE -Dio.netty.uninitializedArrayAllocationThreshold: -1
2020-04-02 10:09:41 io.netty.util.internal.CleanerJava6 FINE java.nio.ByteBuffer.cleaner(): available
2020-04-02 10:09:41 io.netty.util.internal.PlatformDependent FINE -Dio.netty.noPreferDirect: false
2020-04-02 10:09:41 io.netty.util.internal.PlatformDependent FINE org.jctools-core.MpscChunkedArrayQueue: available
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@525b461a
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@61d47554
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@69b794e2
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@3f200884
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@4d339552
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@4461c7e3
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@351d0846
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@77e4c80f
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@35fc6dc4
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@7fe8ea47
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@226a82c4
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@731f8236
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@255b53dc
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@1dd92fe2
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@6b53e23f
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@64d2d351
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@1b68b9a4
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@4f9a3314
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@3b2c72c2
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@491666ad
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@176d53b2
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@971d0d8
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@51931956
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@2b4a2ec7
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@564718df
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@51b7e5df
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@18a70f16
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@62e136d3
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@c8e4bb0
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@6279cee3
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@4206a205
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@29ba4338
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@57175e74
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@7bb58ca3
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@c540f5a
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@770c2e6b
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@1a052a00
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@4d826d77
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@61009542
2020-04-02 10:09:41 io.netty.channel.nio.NioEventLoop FINEST instrumented a special java.util.Set into: sun.nio.ch.WindowsSelectorImpl@77e9807f
2020-04-02 10:09:42 io.netty.util.ResourceLeakDetector FINE -Dio.netty.leakDetection.level: simple
2020-04-02 10:09:42 io.netty.util.ResourceLeakDetector FINE -Dio.netty.leakDetection.targetRecords: 4
2020-04-02 10:09:42 io.netty.buffer.PooledByteBufAllocator FINE -Dio.netty.allocator.numHeapArenas: 16
2020-04-02 10:09:42 io.netty.buffer.PooledByteBufAllocator FINE -Dio.netty.allocator.numDirectArenas: 16
2020-04-02 10:09:42 io.netty.buffer.PooledByteBufAllocator FINE -Dio.netty.allocator.pageSize: 8192
2020-04-02 10:09:42 io.netty.buffer.PooledByteBufAllocator FINE -Dio.netty.allocator.maxOrder: 11
2020-04-02 10:09:42 io.netty.buffer.PooledByteBufAllocator FINE -Dio.netty.allocator.chunkSize: 16777216
2020-04-02 10:09:42 io.netty.buffer.PooledByteBufAllocator FINE -Dio.netty.allocator.tinyCacheSize: 512
2020-04-02 10:09:42 io.netty.buffer.PooledByteBufAllocator FINE -Dio.netty.allocator.smallCacheSize: 256
2020-04-02 10:09:42 io.netty.buffer.PooledByteBufAllocator FINE -Dio.netty.allocator.normalCacheSize: 64
2020-04-02 10:09:42 io.netty.buffer.PooledByteBufAllocator FINE -Dio.netty.allocator.maxCachedBufferCapacity: 32768
2020-04-02 10:09:42 io.netty.buffer.PooledByteBufAllocator FINE -Dio.netty.allocator.cacheTrimInterval: 8192
2020-04-02 10:09:42 io.netty.buffer.PooledByteBufAllocator FINE -Dio.netty.allocator.cacheTrimIntervalMillis: 0
2020-04-02 10:09:42 io.netty.buffer.PooledByteBufAllocator FINE -Dio.netty.allocator.useCacheForAllThreads: true
2020-04-02 10:09:42 io.netty.buffer.PooledByteBufAllocator FINE -Dio.netty.allocator.maxCachedByteBuffersPerChunk: 1023
2020-04-02 10:09:42 io.netty.channel.DefaultChannelId FINE -Dio.netty.processId: 35272 (auto-detected)
2020-04-02 10:09:42 io.netty.util.NetUtil FINE -Djava.net.preferIPv4Stack: false
2020-04-02 10:09:42 io.netty.util.NetUtil FINE -Djava.net.preferIPv6Addresses: false
2020-04-02 10:09:42 io.netty.util.NetUtil FINE Loopback interface: lo (Software Loopback Interface 1, 127.0.0.1)
2020-04-02 10:09:42 io.netty.util.NetUtil FINE Failed to get SOMAXCONN from sysctl and file \proc\sys\net\core\somaxconn. Default: 200
2020-04-02 10:09:42 io.netty.channel.DefaultChannelId FINE -Dio.netty.machineId: 00:50:56:ff:fe:a1:41:80 (auto-detected)
2020-04-02 10:09:42 io.netty.buffer.ByteBufUtil FINE -Dio.netty.allocator.type: pooled
2020-04-02 10:09:42 io.netty.buffer.ByteBufUtil FINE -Dio.netty.threadLocalDirectBufferSize: 0
2020-04-02 10:09:42 io.netty.buffer.ByteBufUtil FINE -Dio.netty.maxThreadLocalCharBufferSize: 16384
2020-04-02 10:09:42 org.mockserver.cli.Main FINEST logger level is TRACE, change using:
- 'ConfigurationProperties.logLevel(String level)' in Java code,
- '-logLevel' command line argument,
- 'mockserver.logLevel' JVM system property or,
- 'mockserver.logLevel' property value in 'mockserver.properties'
2020-04-02 10:09:42 org.mockserver.log.MockServerEventLog INFO started on port: 55555
waiting for MockServer to start retries remaining: 110
2020-04-02 10:09:42 io.netty.util.Recycler FINE -Dio.netty.recycler.maxCapacityPerThread: 4096
2020-04-02 10:09:42 io.netty.util.Recycler FINE -Dio.netty.recycler.maxSharedCapacityFactor: 2
2020-04-02 10:09:42 io.netty.util.Recycler FINE -Dio.netty.recycler.linkCapacity: 16
2020-04-02 10:09:42 io.netty.util.Recycler FINE -Dio.netty.recycler.ratio: 8
2020-04-02 10:09:42 io.netty.buffer.AbstractByteBuf FINE -Dio.netty.buffer.checkAccessible: true
2020-04-02 10:09:42 io.netty.buffer.AbstractByteBuf FINE -Dio.netty.buffer.checkBounds: true
2020-04-02 10:09:42 io.netty.util.ResourceLeakDetectorFactory FINE Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@77f40934
2020-04-02 10:09:42 PortUnificationHandler-last FINEST [id: 0x96649986, L:view-localhost/127.0.0.1:55555 - R:/127.0.0.1:63538] RECEIVED(0B)
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
+--------+-------------------------------------------------+----------------+
channel: 96649986
current: LoggingHandler#0
pipeline: [HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, LoggingHandler#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
2020-04-02 10:09:42 org.mockserver.log.MockServerEventLog FINEST received request:
{
"method" : "PUT",
"path" : "/mockserver/retrieve",
"queryStringParameters" : {
"type" : [ "ACTIVE_EXPECTATIONS" ]
},
"headers" : {
"Host" : [ "localhost:55555" ],
"Connection" : [ "close" ],
"Content-Length" : [ "0" ]
},
"keepAlive" : false,
"secure" : false
}
2020-04-02 10:09:42 org.mockserver.log.MockServerEventLog INFO retrieving active expectations in json that match:
{ }
2020-04-02 10:09:42 PortUnificationHandler-last FINEST [id: 0x96649986, L:view-localhost/127.0.0.1:55555 - R:/127.0.0.1:63538] WRITE(2B)
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 5b 5d |[] |
+--------+-------------------------------------------------+----------------+
channel: 96649986
current: LoggingHandler#0
pipeline: [HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, LoggingHandler#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
2020-04-02 10:09:42 PortUnificationHandler-last FINEST [id: 0x96649986, L:view-localhost/127.0.0.1:55555 - R:/127.0.0.1:63538] FLUSH
channel: 96649986
current: LoggingHandler#0
pipeline: [HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, LoggingHandler#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
2020-04-02 10:09:42 PortUnificationHandler-last FINEST [id: 0x96649986, L:view-localhost/127.0.0.1:55555 - R:/127.0.0.1:63538] CLOSE()
channel: 96649986
current: LoggingHandler#0
pipeline: [HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, LoggingHandler#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
started MockServer
2020-04-02 10:09:42 PortUnificationHandler-last FINEST [id: 0x96649986, L:view-localhost/127.0.0.1:55555 ! R:/127.0.0.1:63538] CLOSE()
channel: 96649986
current: LoggingHandler#0
pipeline: [HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, LoggingHandler#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
2020-04-02 10:09:42 org.mockserver.log.MockServerEventLog FINE disconnected and closed socket view-localhost/127.0.0.1:55555
2020-04-02 10:09:42 PortUnificationHandler-first FINEST [id: 0x96649986, L:view-localhost/127.0.0.1:55555 ! R:/127.0.0.1:63538] FLUSH
channel: 96649986
current: LoggingHandler#0
pipeline: [LoggingHandler#0, HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
2020-04-02 10:09:42 PortUnificationHandler-first FINEST [id: 0x96649986, L:view-localhost/127.0.0.1:55555 ! R:/127.0.0.1:63538] INACTIVE
channel: 96649986
current: LoggingHandler#0
pipeline: [LoggingHandler#0, HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
2020-04-02 10:09:42 PortUnificationHandler-first FINEST [id: 0x96649986, L:view-localhost/127.0.0.1:55555 ! R:/127.0.0.1:63538] UNREGISTERED
channel: 96649986
current: LoggingHandler#0
pipeline: [LoggingHandler#0, HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
2020-04-02 10:09:42 PortUnificationHandler-last FINEST [id: 0x6d8f4ba7, L:/127.0.0.1:55555 - R:/127.0.0.1:63539] RECEIVED(247B)
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 7b 22 68 74 74 70 52 65 71 75 65 73 74 22 3a 7b |{"httpRequest":{|
|00000010| 22 6d 65 74 68 6f 64 22 3a 22 50 4f 53 54 22 2c |"method":"POST",|
|00000020| 22 70 61 74 68 22 3a 22 2f 61 70 69 2f 51 75 65 |"path":"/api/Que|
|00000030| 75 65 22 2c 22 68 65 61 64 65 72 73 22 3a 5b 5d |ue","headers":[]|
|00000040| 7d 2c 22 68 74 74 70 52 65 73 70 6f 6e 73 65 54 |},"httpResponseT|
|00000050| 65 6d 70 6c 61 74 65 22 3a 7b 22 74 65 6d 70 6c |emplate":{"templ|
|00000060| 61 74 65 22 3a 22 72 65 74 75 72 6e 20 7b 20 73 |ate":"return { s|
|00000070| 74 61 74 75 73 43 6f 64 65 3a 20 32 30 30 2c 20 |tatusCode: 200, |
|00000080| 62 6f 64 79 3a 20 4a 53 4f 4e 2e 73 74 72 69 6e |body: JSON.strin|
|00000090| 67 69 66 79 28 7b 54 72 61 6e 73 61 63 74 69 6f |gify({Transactio|
|000000a0| 6e 49 64 3a 20 67 65 74 52 61 6e 64 6f 6d 4c 6f |nId: getRandomLo|
|000000b0| 6e 67 28 29 2c 20 51 75 65 75 65 64 3a 20 74 72 |ng(), Queued: tr|
|000000c0| 75 65 2c 20 48 61 73 45 72 72 6f 72 3a 20 66 61 |ue, HasError: fa|
|000000d0| 6c 73 65 7d 29 20 7d 3b 22 2c 22 74 65 6d 70 6c |lse}) };","templ|
|000000e0| 61 74 65 54 79 70 65 22 3a 22 4a 41 56 41 53 43 |ateType":"JAVASC|
|000000f0| 52 49 50 54 22 7d 7d |RIPT"}} |
+--------+-------------------------------------------------+----------------+
channel: 6d8f4ba7
current: LoggingHandler#0
pipeline: [HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, LoggingHandler#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
2020-04-02 10:09:42 org.mockserver.log.MockServerEventLog FINEST received request:
{
"method" : "PUT",
"path" : "/expectation",
"headers" : {
"Content-Type" : [ "application/json; charset=utf-8" ],
"Host" : [ "localhost:55555" ],
"Connection" : [ "close" ],
"content-length" : [ "247" ]
},
"keepAlive" : false,
"secure" : false,
"body" : {
"httpRequest" : {
"method" : "POST",
"path" : "/api/Queue",
"headers" : [ ]
},
"httpResponseTemplate" : {
"template" : "return { statusCode: 200, body: JSON.stringify({TransactionId: getRandomLong(), Queued: true, HasError: false}) };",
"templateType" : "JAVASCRIPT"
}
}
}
2020-04-02 10:09:43 PortUnificationHandler-last FINEST [id: 0x6d8f4ba7, L:/127.0.0.1:55555 - R:/127.0.0.1:63539] WRITE(0B)
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
+--------+-------------------------------------------------+----------------+
channel: 6d8f4ba7
current: LoggingHandler#0
pipeline: [HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, LoggingHandler#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
2020-04-02 10:09:43 PortUnificationHandler-last FINEST [id: 0x6d8f4ba7, L:/127.0.0.1:55555 - R:/127.0.0.1:63539] FLUSH
channel: 6d8f4ba7
current: LoggingHandler#0
pipeline: [HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, LoggingHandler#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
2020-04-02 10:09:43 PortUnificationHandler-last FINEST [id: 0x6d8f4ba7, L:/127.0.0.1:55555 - R:/127.0.0.1:63539] CLOSE()
channel: 6d8f4ba7
current: LoggingHandler#0
pipeline: [HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, LoggingHandler#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
Queue expectation created.
2020-04-02 10:09:43 PortUnificationHandler-last FINEST [id: 0x6d8f4ba7, L:/127.0.0.1:55555 ! R:/127.0.0.1:63539] CLOSE()
channel: 6d8f4ba7
current: LoggingHandler#0
pipeline: [HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, LoggingHandler#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
2020-04-02 10:09:43 PortUnificationHandler-first FINEST [id: 0x6d8f4ba7, L:/127.0.0.1:55555 ! R:/127.0.0.1:63539] FLUSH
channel: 6d8f4ba7
current: LoggingHandler#0
pipeline: [LoggingHandler#0, HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
2020-04-02 10:09:43 PortUnificationHandler-first FINEST [id: 0x6d8f4ba7, L:/127.0.0.1:55555 ! R:/127.0.0.1:63539] INACTIVE
channel: 6d8f4ba7
current: LoggingHandler#0
pipeline: [LoggingHandler#0, HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
2020-04-02 10:09:43 PortUnificationHandler-first FINEST [id: 0x6d8f4ba7, L:/127.0.0.1:55555 ! R:/127.0.0.1:63539] UNREGISTERED
channel: 6d8f4ba7
current: LoggingHandler#0
pipeline: [LoggingHandler#0, HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
2020-04-02 10:09:43 org.mockserver.log.MockServerEventLog INFO creating expectation:
{
"id" : "e209f147-71bc-4443-a442-34a4866763eb",
"priority" : 0,
"httpRequest" : {
"method" : "POST",
"path" : "/api/Queue"
},
"times" : {
"unlimited" : true
},
"timeToLive" : {
"unlimited" : true
},
"httpResponseTemplate" : {
"templateType" : "JAVASCRIPT",
"template" : "return { statusCode: 200, body: JSON.stringify({TransactionId: getRandomLong(), Queued: true, HasError: false}) };"
}
}
2020-04-02 10:09:43 org.mockserver.log.MockServerEventLog FINE disconnected and closed socket /127.0.0.1:55555
2020-04-02 10:09:50 PortUnificationHandler-last FINEST [id: 0xcce03aef, L:0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:55555 - R:/0:0:0:0:0:0:0:1:63545] RECEIVED(0B)
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
+--------+-------------------------------------------------+----------------+
channel: cce03aef
current: LoggingHandler#0
pipeline: [HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, LoggingHandler#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
2020-04-02 10:09:50 org.mockserver.log.MockServerEventLog FINEST received request:
{
"method" : "POST",
"path" : "/api/queue",
"headers" : {
"User-Agent" : [ "PostmanRuntime/7.23.0" ],
"Accept" : [ "*/*" ],
"Cache-Control" : [ "no-cache" ],
"Postman-Token" : [ "e46638fd-486e-46b8-9985-a49451cc1216" ],
"Host" : [ "localhost:55555" ],
"Accept-Encoding" : [ "gzip, deflate, br" ],
"Content-Length" : [ "0" ],
"Connection" : [ "keep-alive" ]
},
"keepAlive" : true,
"secure" : false
}
2020-04-02 10:09:50 org.mockserver.log.MockServerEventLog INFO received request:
{
"method" : "POST",
"path" : "/api/queue",
"headers" : {
"User-Agent" : [ "PostmanRuntime/7.23.0" ],
"Accept" : [ "*/*" ],
"Cache-Control" : [ "no-cache" ],
"Postman-Token" : [ "e46638fd-486e-46b8-9985-a49451cc1216" ],
"Host" : [ "localhost:55555" ],
"Accept-Encoding" : [ "gzip, deflate, br" ],
"Content-Length" : [ "0" ],
"Connection" : [ "keep-alive" ]
},
"keepAlive" : true,
"secure" : false
}
2020-04-02 10:09:50 org.mockserver.log.MockServerEventLog INFO request:
{
"method" : "POST",
"path" : "/api/queue",
"headers" : {
"User-Agent" : [ "PostmanRuntime/7.23.0" ],
"Accept" : [ "*/*" ],
"Cache-Control" : [ "no-cache" ],
"Postman-Token" : [ "e46638fd-486e-46b8-9985-a49451cc1216" ],
"Host" : [ "localhost:55555" ],
"Accept-Encoding" : [ "gzip, deflate, br" ],
"Content-Length" : [ "0" ],
"Connection" : [ "keep-alive" ]
},
"keepAlive" : true,
"secure" : false
}
matched expectation:
{
"id" : "e209f147-71bc-4443-a442-34a4866763eb",
"priority" : 0,
"httpRequest" : {
"method" : "POST",
"path" : "/api/Queue"
},
"times" : {
"unlimited" : true
},
"timeToLive" : {
"unlimited" : true
},
"httpResponseTemplate" : {
"templateType" : "JAVASCRIPT",
"template" : "return { statusCode: 200, body: JSON.stringify({TransactionId: getRandomLong(), Queued: true, HasError: false}) };"
}
}
2020-04-02 10:09:50 PortUnificationHandler-last FINEST [id: 0xcce03aef, L:0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:55555 - R:/0:0:0:0:0:0:0:1:63545] WRITE(0B)
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
+--------+-------------------------------------------------+----------------+
channel: cce03aef
current: LoggingHandler#0
pipeline: [HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, LoggingHandler#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
2020-04-02 10:09:50 org.mockserver.log.MockServerEventLog INFO returning response:
{
"statusCode" : 404,
"reasonPhrase" : "Not Found"
}
for request:
{
"method" : "POST",
"path" : "/api/queue",
"headers" : {
"User-Agent" : [ "PostmanRuntime/7.23.0" ],
"Accept" : [ "*/*" ],
"Cache-Control" : [ "no-cache" ],
"Postman-Token" : [ "e46638fd-486e-46b8-9985-a49451cc1216" ],
"Host" : [ "localhost:55555" ],
"Accept-Encoding" : [ "gzip, deflate, br" ],
"Content-Length" : [ "0" ],
"Connection" : [ "keep-alive" ]
},
"keepAlive" : true,
"secure" : false
}
for action:
{
"templateType" : "JAVASCRIPT",
"template" : "return { statusCode: 200, body: JSON.stringify({TransactionId: getRandomLong(), Queued: true, HasError: false}) };"
}
2020-04-02 10:09:50 PortUnificationHandler-last FINEST [id: 0xcce03aef, L:0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:55555 - R:/0:0:0:0:0:0:0:1:63545] FLUSH
channel: cce03aef
current: LoggingHandler#0
pipeline: [HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, LoggingHandler#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]
2020-04-02 10:09:50 org.mockserver.log.MockServerEventLog INFO Exception transforming template:
function handle(request) {
return { statusCode: 200, body: JSON.stringify({TransactionId: getRandomLong(), Queued: true, HasError: false}) };
}
for request:
{
"method" : "POST",
"path" : "/api/queue",
"headers" : {
"User-Agent" : [ "PostmanRuntime/7.23.0" ],
"Accept" : [ "*/*" ],
"Cache-Control" : [ "no-cache" ],
"Postman-Token" : [ "e46638fd-486e-46b8-9985-a49451cc1216" ],
"Host" : [ "localhost:55555" ],
"Accept-Encoding" : [ "gzip, deflate, br" ],
"Content-Length" : [ "0" ],
"Connection" : [ "keep-alive" ]
},
"keepAlive" : true,
"secure" : false
}
java.lang.RuntimeException: Exception transforming template:
function handle(request) {
return { statusCode: 200, body: JSON.stringify({TransactionId: getRandomLong(), Queued: true, HasError: false}) };
}
for request:
{
"method" : "POST",
"path" : "/api/queue",
"headers" : {
"User-Agent" : [ "PostmanRuntime/7.23.0" ],
"Accept" : [ "*/*" ],
"Cache-Control" : [ "no-cache" ],
"Postman-Token" : [ "e46638fd-486e-46b8-9985-a49451cc1216" ],
"Host" : [ "localhost:55555" ],
"Accept-Encoding" : [ "gzip, deflate, br" ],
"Content-Length" : [ "0" ],
"Connection" : [ "keep-alive" ]
},
"keepAlive" : true,
"secure" : false
}
at org.mockserver.templates.engine.javascript.JavaScriptTemplateEngine.executeTemplate(JavaScriptTemplateEngine.java:76)
at org.mockserver.mock.action.HttpResponseTemplateActionHandler.handle(HttpResponseTemplateActionHandler.java:42)
at org.mockserver.mock.action.ActionHandler.lambda$null$3(ActionHandler.java:103)
at org.mockserver.mock.action.ActionHandler.handleAnyException(ActionHandler.java:285)
at org.mockserver.mock.action.ActionHandler.lambda$processAction$4(ActionHandler.java:102)
at org.mockserver.scheduler.Scheduler.run(Scheduler.java:67)
at org.mockserver.scheduler.Scheduler.schedule(Scheduler.java:104)
at org.mockserver.mock.action.ActionHandler.processAction(ActionHandler.java:102)
at org.mockserver.netty.MockServerHandler.channelRead0(MockServerHandler.java:147)
at org.mockserver.netty.MockServerHandler.channelRead0(MockServerHandler.java:46)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at org.mockserver.dashboard.DashboardWebSocketServerHandler.channelRead(DashboardWebSocketServerHandler.java:130)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at org.mockserver.closurecallback.websocketregistry.CallbackWebSocketServerHandler.channelRead(CallbackWebSocketServerHandler.java:56)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at org.mockserver.logging.LoggingHandler.channelRead(LoggingHandler.java:170)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at org.mockserver.netty.unification.PortUnificationHandler.switchToHttp(PortUnificationHandler.java:239)
at org.mockserver.netty.unification.PortUnificationHandler.decode(PortUnificationHandler.java:127)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:498)
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at java.lang.Thread.run(Unknown Source)
Caused by: <eval>:3 ReferenceError: "getRandomLong" is not defined
at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319)
at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291)
at jdk.nashorn.internal.objects.Global.__noSuchProperty__(Global.java:1442)
at jdk.nashorn.internal.scripts.Script$Recompilation$4$25A$\^eval\_.handle(<eval>:3)
at jdk.nashorn.internal.scripts.Script$Recompilation$3$178A$\^eval\_.serialise(<eval>:4)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:639)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
at jdk.nashorn.api.scripting.ScriptObjectMirror.call(ScriptObjectMirror.java:117)
at org.mockserver.templates.engine.javascript.JavaScriptTemplateEngine.executeTemplate(JavaScriptTemplateEngine.java:50)
... 66 more
2020-04-02 10:09:50 PortUnificationHandler-first FINEST [id: 0xcce03aef, L:0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:55555 - R:/0:0:0:0:0:0:0:1:63545] FLUSH
channel: cce03aef
current: LoggingHandler#0
pipeline: [LoggingHandler#0, HttpServerCodec#0, HttpContentDecompressor#0, HttpContentLengthRemover#0, HttpObjectAggregator#0, CallbackWebSocketServerHandler#0, DashboardWebSocketServerHandler#0, MockServerServerCodec#0, MockServerHandler#0, DefaultChannelPipeline$TailContext#0]