Page History
...
| Code Block | ||||
|---|---|---|---|---|
| ||||
import akka.testkit.javadsl.TestKit;
@RunWith(SpringRunner.class)
@SpringBootTest
public class CachedbApplicationTests {
@Autowired
ApplicationContext context;
@Test
public void contextLoads() {
ActorSystem system = context.getBean(ActorSystem.class);
SpringExtension ext = context.getBean(SpringExtension.class);
actorTest2(system,ext);
}
protected void actorTest2(ActorSystem system,SpringExtension ext) {
ActorRef testActor = system.actorOf(ext.props("testActor"),"service1");
new TestKit(system) {{
testActor.tell( "hi", getRef() );
// await the correct response
expectMsg(java.time.Duration.ofSeconds(1), "너의 메시지에 응답을함");
}};
}
} |
| Expand | |||||||
|---|---|---|---|---|---|---|---|
| |||||||
|
full src : http://git.webnori.com/projects/WEBF/repos/spring_cachedb/browse
...