@Test public void getByNameOrDefaultReturnsProjectWithMatchingNameAndTarget() { var expectedName = "projection-name"; var expectedTarget = String.class; Pair<String, Class<?>> pair = Pair.of(expectedName, expectedTarget); projectionService.projectionClassMap.put(pair, annotatedClass); var actualProjection = projectionService.getByNameOrDefault(expectedName, expectedTarget); assertThat(actualProjection).isEqualTo(annotatedClass); }
public Class<?> getByNameOrDefault(@NonNull String projectionName, @NonNull Class<?> projectionTarget) { return projectionClassMap.getOrDefault(Pair.of(projectionName, projectionTarget), getDefault(projectionTarget)); }
ProjectionService implements InitializingBean { public Class<?> getByNameOrDefault(@NonNull String projectionName, @NonNull Class<?> projectionTarget) { return projectionClassMap.getOrDefault(Pair.of(projectionName, projectionTarget), getDefault(projectionTarget)); } }
ProjectionService implements InitializingBean { public Class<?> getByNameOrDefault(@NonNull String projectionName, @NonNull Class<?> projectionTarget) { return projectionClassMap.getOrDefault(Pair.of(projectionName, projectionTarget), getDefault(projectionTarget)); } @Autowired  ProjectionService(AnnotatedTypeScanner typeScanner, AnnotationUtilsWrapper annotationUtilsWrapper); }
ProjectionService implements InitializingBean { public Class<?> getByNameOrDefault(@NonNull String projectionName, @NonNull Class<?> projectionTarget) { return projectionClassMap.getOrDefault(Pair.of(projectionName, projectionTarget), getDefault(projectionTarget)); } @Autowired  ProjectionService(AnnotatedTypeScanner typeScanner, AnnotationUtilsWrapper annotationUtilsWrapper); Class<?> getByNameOrDefault(@NonNull String projectionName, @NonNull Class<?> projectionTarget); Class<?> getDefault(Class<?> projectionTarget); @Override void afterPropertiesSet(); }
ProjectionService implements InitializingBean { public Class<?> getByNameOrDefault(@NonNull String projectionName, @NonNull Class<?> projectionTarget) { return projectionClassMap.getOrDefault(Pair.of(projectionName, projectionTarget), getDefault(projectionTarget)); } @Autowired  ProjectionService(AnnotatedTypeScanner typeScanner, AnnotationUtilsWrapper annotationUtilsWrapper); Class<?> getByNameOrDefault(@NonNull String projectionName, @NonNull Class<?> projectionTarget); Class<?> getDefault(Class<?> projectionTarget); @Override void afterPropertiesSet();  }