分布式-raft
作者:互联网
mini-raft
raft implementation 8 java
todo
依赖
- jdk11
- springboot
- brpc
- rocksdb
测试
-
启动服务端
cd mini-raft-server/deply && sh ./deploy.sh
-
启动客户端 mini-raft-client
@SpringBootTest @RunWith(SpringRunner.class) public class CurdControllerTest extends TestCase { private MockMvc mockMvc; @Autowired private WebApplicationContext wac; @Before public void before() { this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); } @Test public void getOp() throws Exception { String key = "hello00"; MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.get("/client/get").contentType(MediaType.APPLICATION_JSON).param("key", key)).andExpect(MockMvcResultMatchers.status().isOk()).andDo(MockMvcResultHandlers.print()).andReturn(); } @Test public void putOp() throws Exception { String key = "hello00"; String value = "world00"; MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.get("/client/put").contentType(MediaType.APPLICATION_JSON).param("key", key).param("value", value)).andExpect(MockMvcResultMatchers.status().isOk()).andDo(MockMvcResultHandlers.print()).andReturn(); } }
标签:mini,String,key,mockMvc,raft,public,分布式 来源: https://www.cnblogs.com/miss-u/p/16148611.html