BadgeIssuerActor extends BaseActor { private void getBadgeIssuer(Request actorMessage) throws IOException { Response response = badgingService.getIssuerDetails(actorMessage); sender().tell(response, self()); } BadgeIssuerActor();  BadgeIssuerActor(BadgingService badgingService); @Override void onReceive(Request request);  }
@Test public void testGetBadgeIssuer() throws IOException { Response response = new Response(); response.put(JsonKey.RESPONSE, createHttpUtilRes(200, mapToJson(createBadgeIssuerResponse()))); PowerMockito.when(mockBadgingService.getIssuerDetails(actorMessage)).thenReturn(response); actorMessage.setOperation(BadgeOperations.getBadgeIssuer.name()); subject.tell(actorMessage, probe.getRef()); Response resp = probe.expectMsgClass(ACTOR_MAX_WAIT_DURATION, Response.class); Assert.assertTrue(null != resp); }