@Test @Order(1) void handlingDssAuthenticationCommandRequest() { restAuthActorRef.tell(DssAuthenticationCommandRequest .builder() .userID("testID") .userPassword("testPassword") .token(probe.ref()) .build()); final DssAuthenticationCommandResponse response = probe.expectMessageClass(DssAuthenticationCommandResponse.class); testToken = response.getToken(); assertTrue(true); assertNotNull(response.getToken()); }
private Behavior<DssAuthCommand> handlingDssAuthenticationCommandRequest(DssAuthenticationCommandRequest request) { context.getLog().info("DssAuthenticationCommandRequest: {}", request); String userID = request.getUserID(); String userPassword = request.getUserPassword(); String token = null; String search = userList.get(userID); if(Objects.nonNull(search) && search.equals(userPassword)) { token = createToken(userID); tokenList.add(token); } request.getToken().tell(DssAuthenticationCommandResponse .builder() .token(token) .build() ); return Behaviors.same(); }
DssRestAuthActor { private Behavior<DssAuthCommand> handlingDssAuthenticationCommandRequest(DssAuthenticationCommandRequest request) { context.getLog().info("DssAuthenticationCommandRequest: {}", request); String userID = request.getUserID(); String userPassword = request.getUserPassword(); String token = null; String search = userList.get(userID); if(Objects.nonNull(search) && search.equals(userPassword)) { token = createToken(userID); tokenList.add(token); } request.getToken().tell(DssAuthenticationCommandResponse .builder() .token(token) .build() ); return Behaviors.same(); } }
DssRestAuthActor { private Behavior<DssAuthCommand> handlingDssAuthenticationCommandRequest(DssAuthenticationCommandRequest request) { context.getLog().info("DssAuthenticationCommandRequest: {}", request); String userID = request.getUserID(); String userPassword = request.getUserPassword(); String token = null; String search = userList.get(userID); if(Objects.nonNull(search) && search.equals(userPassword)) { token = createToken(userID); tokenList.add(token); } request.getToken().tell(DssAuthenticationCommandResponse .builder() .token(token) .build() ); return Behaviors.same(); } private  DssRestAuthActor(ActorContext<DssAuthCommand> context, Map<String, String> userList); }
DssRestAuthActor { private Behavior<DssAuthCommand> handlingDssAuthenticationCommandRequest(DssAuthenticationCommandRequest request) { context.getLog().info("DssAuthenticationCommandRequest: {}", request); String userID = request.getUserID(); String userPassword = request.getUserPassword(); String token = null; String search = userList.get(userID); if(Objects.nonNull(search) && search.equals(userPassword)) { token = createToken(userID); tokenList.add(token); } request.getToken().tell(DssAuthenticationCommandResponse .builder() .token(token) .build() ); return Behaviors.same(); } private  DssRestAuthActor(ActorContext<DssAuthCommand> context, Map<String, String> userList); static Behavior<DssAuthCommand> create(Map<String, String> userList); }
DssRestAuthActor { private Behavior<DssAuthCommand> handlingDssAuthenticationCommandRequest(DssAuthenticationCommandRequest request) { context.getLog().info("DssAuthenticationCommandRequest: {}", request); String userID = request.getUserID(); String userPassword = request.getUserPassword(); String token = null; String search = userList.get(userID); if(Objects.nonNull(search) && search.equals(userPassword)) { token = createToken(userID); tokenList.add(token); } request.getToken().tell(DssAuthenticationCommandResponse .builder() .token(token) .build() ); return Behaviors.same(); } private  DssRestAuthActor(ActorContext<DssAuthCommand> context, Map<String, String> userList); static Behavior<DssAuthCommand> create(Map<String, String> userList);  }