-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMain.java
More file actions
27 lines (23 loc) · 1.13 KB
/
Main.java
File metadata and controls
27 lines (23 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.askattest.interview;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.picocontainer.DefaultPicoContainer;
import org.picocontainer.MutablePicoContainer;
import com.askattest.interview.models.RespondentEarning;
import com.askattest.interview.repository.*;
import com.askattest.interview.service.*;
public class Main {
public static void main(String[] args) {
MutablePicoContainer container = new DefaultPicoContainer();
container.addComponent(ISurveyRepo.class, SurveyRepo.class);
container.addComponent(IResponseRepo.class, ResponseRepo.class);
container.addComponent(IQuestionCacheRepo.class, QuestionCacheRepo.class);
container.addComponent(IEarningService.class, EarningService.class);
IEarningService earningService = container.getComponent(IEarningService.class);
Map<Integer, RespondentEarning> respondentEarnings = earningService.calculateEarningsByRespondent();
respondentEarnings.values().forEach(respondentEarning ->
Logger.getGlobal().log(Level.INFO, respondentEarning.toString())
);
}
}