-
-
Save bsideup/bccb43ef3ccfa3542f34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ @Autowired | |
+ ThriftCodecManager thriftCodecManager; | |
+ | |
@Value("${local.server.port}") | |
protected int port; | |
- | |
- protected TCalculatorService.Iface client; | |
+ | |
+ protected TCalculatorService client; | |
@Before | |
public void setUp() throws Exception { | |
- TTransport transport = new THttpClient("http://localhost:" + port + "/calculator/"); | |
- | |
- TProtocol protocol = protocolFactory.getProtocol(transport); | |
- | |
- client = new TCalculatorService.Client(protocol); | |
+ HttpClientConnector connector = new HttpClientConnector(URI.create("http://localhost:" + port + "/thrift/")); | |
+ | |
+ ThriftClientManager clientManager = new ThriftClientManager(thriftCodecManager); | |
+ client = clientManager.createClient(connector, TCalculatorService.class).get(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment