### Question:
AnnotationDefinitionFactory { public InLog buildInLog(Set<String> loggerNames, Method method) { Log.in logIn = annotationExtractor.findLogIn(method, loggerNames); if (nonNull(logIn)) { return buildInLog(method, logIn); } Log log = annotationExtractor.findLog(method, loggerNames); if (nonNull(log)) { return buildInLog(method, annotationExtractor.synthesizeLogIn(log)); } return null; } AnnotationDefinitionFactory(PrinterResolver printerResolver); InLog buildInLog(Set<String> loggerNames, Method method); List<ParameterLog> buildParameterLogs(Set<String> loggerNames, Method method); OutLog buildOutLog(Set<String> loggerNames, Method method); Set<ErrorLog> buildErrorLogs(Set<String> loggerNames, Method method); Set<ParameterMdc> buildMethodParameterMdcs(Method method); List<Set<ParameterMdc>> buildParameterMdcs(Method method);  }### Answer:
@Test public void buildInLogByLogIn() throws NoSuchMethodException { Set<String> loggerNames = singleton(""); Method method = LogInLoggableClass.class.getDeclaredMethod("logIn", String.class, String.class); InLog inLog = annotationDefinitionFactory.buildInLog(loggerNames, method); assertNotNull(inLog); assertThat(inLog.getLevel(), is(INFO)); }
@Test public void buildInLogByLog() throws NoSuchMethodException { Set<String> loggerNames = singleton(""); Method method = LogInLoggableClass.class.getDeclaredMethod("log", String.class, String.class); InLog inLog = annotationDefinitionFactory.buildInLog(loggerNames, method); assertNotNull(inLog); assertThat(inLog.getLevel(), is(WARN)); }
@Test public void buildInLogByLogWithAlias() throws NoSuchMethodException { Set<String> loggerNames = singleton(""); Method method = LogInLoggableClass.class.getDeclaredMethod("logWithAlias", String.class, String.class); InLog inLog = annotationDefinitionFactory.buildInLog(loggerNames, method); assertNotNull(inLog); assertThat(inLog.getLevel(), is(WARN)); }
@Test public void buildInLogEmpty() throws NoSuchMethodException { Set<String> loggerNames = singleton(""); Method method = LogInLoggableClass.class.getDeclaredMethod("empty", String.class, String.class); InLog inLog = annotationDefinitionFactory.buildInLog(loggerNames, method); assertThat(inLog, nullValue()); }
@Test public void buildInLogByLogIns() throws NoSuchMethodException { Set<String> loggerNames = singleton(""); Method method = LogInLoggableClass.class.getDeclaredMethod("logIns"); InLog inLog = annotationDefinitionFactory.buildInLog(loggerNames, method); assertNotNull(inLog); assertThat(inLog.getLevel(), is(ERROR)); }
@Test public void buildInLogByLogs() throws NoSuchMethodException { Set<String> loggerNames = singleton(""); Method method = LogInLoggableClass.class.getDeclaredMethod("logs"); InLog inLog = annotationDefinitionFactory.buildInLog(loggerNames, method); assertNotNull(inLog); assertThat(inLog.getLevel(), is(ERROR)); }