How to reorganize test code along with production code?

Suppose you start with an automatically generated method

public void setKey(Key key) {
    this.key = key;
}

And write a test for him

@Test
public void testSetKey() 

Then after 3 months you decide what will be the more suitable name for the method changeKeyTo. You will reorganize your production code and as a result:

public void changeKeyTo(Key key) {
    this.key = key;
}

Life is good, however your test name has not changed

@Test
public void testSetKey() 

How do you deal with something like that? Can you reuse test code with your production code? Does eclipse resolve this?

+5
source share
2 answers

eclipse : , .
, , API- refactoring eclipse, , .
- , : -)

+1

IDE ( , IDE ). IIRC Eclipse , . IntelliJ, , .

0

All Articles