@Test void getActorCrnFromService() { ActorService actorService = ActorService.builder().withActorServiceName("datahub").build(); String crn = underTest.getActorCrn(actorService); assertThat(crn).isEqualTo(INTERNAL_ACTOR_CRN); }
public String getActorCrn(ActorBase actorBase) { String actorCrn; if (actorBase instanceof ActorCrn) { ActorCrn actor = (ActorCrn) actorBase; actorCrn = actor.getActorCrn(); } else if (actorBase instanceof ActorService) { actorCrn = INTERNAL_ACTOR_CRN; } else { throw new IllegalArgumentException("Actor has an invalid class: " + actorBase.getClass().getName()); } return actorCrn; }
ActorUtil { public String getActorCrn(ActorBase actorBase) { String actorCrn; if (actorBase instanceof ActorCrn) { ActorCrn actor = (ActorCrn) actorBase; actorCrn = actor.getActorCrn(); } else if (actorBase instanceof ActorService) { actorCrn = INTERNAL_ACTOR_CRN; } else { throw new IllegalArgumentException("Actor has an invalid class: " + actorBase.getClass().getName()); } return actorCrn; } }
ActorUtil { public String getActorCrn(ActorBase actorBase) { String actorCrn; if (actorBase instanceof ActorCrn) { ActorCrn actor = (ActorCrn) actorBase; actorCrn = actor.getActorCrn(); } else if (actorBase instanceof ActorService) { actorCrn = INTERNAL_ACTOR_CRN; } else { throw new IllegalArgumentException("Actor has an invalid class: " + actorBase.getClass().getName()); } return actorCrn; }  }
ActorUtil { public String getActorCrn(ActorBase actorBase) { String actorCrn; if (actorBase instanceof ActorCrn) { ActorCrn actor = (ActorCrn) actorBase; actorCrn = actor.getActorCrn(); } else if (actorBase instanceof ActorService) { actorCrn = INTERNAL_ACTOR_CRN; } else { throw new IllegalArgumentException("Actor has an invalid class: " + actorBase.getClass().getName()); } return actorCrn; }  String getActorCrn(ActorBase actorBase); }
ActorUtil { public String getActorCrn(ActorBase actorBase) { String actorCrn; if (actorBase instanceof ActorCrn) { ActorCrn actor = (ActorCrn) actorBase; actorCrn = actor.getActorCrn(); } else if (actorBase instanceof ActorService) { actorCrn = INTERNAL_ACTOR_CRN; } else { throw new IllegalArgumentException("Actor has an invalid class: " + actorBase.getClass().getName()); } return actorCrn; }  String getActorCrn(ActorBase actorBase);  }