@Test public void testExecute() throws Exception { final String buildUuid = randomUUID().toString(); final String functionName = randomUUID().toString(); router.execute(buildUuid, functionName, new ContractInput()); verify(contractService).tryExecute(anyString(), anyString(), any(String[].class)); }
@PostMapping(value = "contract/{tx}/{function}") public ExecutionResult execute( @PathVariable("tx") final String contractTransactionHash, @PathVariable("function") final String functionName, @RequestBody final ContractInput contractInput) throws IOException { final String[] arguments = contractInput.getArguments(); return contractService.tryExecute(contractTransactionHash, functionName, arguments); }
Router { @PostMapping(value = "contract/{tx}/{function}") public ExecutionResult execute( @PathVariable("tx") final String contractTransactionHash, @PathVariable("function") final String functionName, @RequestBody final ContractInput contractInput) throws IOException { final String[] arguments = contractInput.getArguments(); return contractService.tryExecute(contractTransactionHash, functionName, arguments); } }
Router { @PostMapping(value = "contract/{tx}/{function}") public ExecutionResult execute( @PathVariable("tx") final String contractTransactionHash, @PathVariable("function") final String functionName, @RequestBody final ContractInput contractInput) throws IOException { final String[] arguments = contractInput.getArguments(); return contractService.tryExecute(contractTransactionHash, functionName, arguments); }  }
Router { @PostMapping(value = "contract/{tx}/{function}") public ExecutionResult execute( @PathVariable("tx") final String contractTransactionHash, @PathVariable("function") final String functionName, @RequestBody final ContractInput contractInput) throws IOException { final String[] arguments = contractInput.getArguments(); return contractService.tryExecute(contractTransactionHash, functionName, arguments); }  @PostConstruct void initialize(); @GetMapping("contract") DeploymentResult getLatestContract(); @GetMapping("builds") List<BuildSummary> getLatestBuilds(); @GetMapping("build/{uuid}") BuildDetails getBuild(@PathVariable("uuid") final String buildUuid); @PostMapping("build/{uuid}/deploy") DeploymentResult deploy(@PathVariable("uuid") final String buildUuid); @PostMapping(value = "contract/{tx}/{function}") ExecutionResult execute(
      @PathVariable("tx") final String contractTransactionHash,
      @PathVariable("function") final String functionName,
      @RequestBody final ContractInput contractInput); @GetMapping(value = "contract/{tx}/{function}") QueryResult query(
      @PathVariable("tx") final String contractTransactionHash,
      @PathVariable("function") final String functionName,
      @RequestParam(value = "arguments", required = false) final String[] arguments
  ); }
Router { @PostMapping(value = "contract/{tx}/{function}") public ExecutionResult execute( @PathVariable("tx") final String contractTransactionHash, @PathVariable("function") final String functionName, @RequestBody final ContractInput contractInput) throws IOException { final String[] arguments = contractInput.getArguments(); return contractService.tryExecute(contractTransactionHash, functionName, arguments); }  @PostConstruct void initialize(); @GetMapping("contract") DeploymentResult getLatestContract(); @GetMapping("builds") List<BuildSummary> getLatestBuilds(); @GetMapping("build/{uuid}") BuildDetails getBuild(@PathVariable("uuid") final String buildUuid); @PostMapping("build/{uuid}/deploy") DeploymentResult deploy(@PathVariable("uuid") final String buildUuid); @PostMapping(value = "contract/{tx}/{function}") ExecutionResult execute(
      @PathVariable("tx") final String contractTransactionHash,
      @PathVariable("function") final String functionName,
      @RequestBody final ContractInput contractInput); @GetMapping(value = "contract/{tx}/{function}") QueryResult query(
      @PathVariable("tx") final String contractTransactionHash,
      @PathVariable("function") final String functionName,
      @RequestParam(value = "arguments", required = false) final String[] arguments
  );  }