Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
+ @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