Skip to content

Commit

Permalink
[긴급] 테스트 실패하는 master 픽스.
Browse files Browse the repository at this point in the history
- CountableNotiManager의 @primary를 삭제.
- NotiManager의 @component를 삭제
  • Loading branch information
임도형 committed May 2, 2018
1 parent 3d54231 commit 8bcc1cd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/net/slipp/todo_list/AppConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@ComponentScan(basePackages = {"net.slipp.todo_list"})
public class AppConfig {
@Bean
public NotiManager NotiManager() {
public NotiManager notiManager() {
return new CountableNotiManager();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Primary
@Component
public class CountableNotiManager extends NotiManager {

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/slipp/todo_list/NotiManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import org.springframework.stereotype.Component;

@Component
// TODO : uncomment when removing CoutableNotiManager
//@Component
public class NotiManager {

public void notify( String title ) throws RuntimeException {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
public class CountableNotiManagerTest {
@Autowired
private TodoManager todoManager;

@Autowired
private CountableNotiManager countableNotiManager;
private NotiManager notiManager;

@Before
public void setUp() throws Exception {
Expand All @@ -39,9 +40,9 @@ public void tearDown() throws Exception {
todo.setTitle(TITLE);
todo.setContent(CONTENT);

int previousNotiCount = countableNotiManager.getCallCount();
int previousNotiCount = ((CountableNotiManager)notiManager).getCallCount();
todoManager.create(todo);
int afterNotiCount = countableNotiManager.getCallCount();
int afterNotiCount = ((CountableNotiManager)notiManager).getCallCount();

assertEquals(afterNotiCount, previousNotiCount + 1);
}
Expand Down

0 comments on commit 8bcc1cd

Please sign in to comment.