Skip to content

Commit

Permalink
Addressing Code style: don't do star imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Adolfo Joel Cueto committed Nov 14, 2016
1 parent 3090258 commit f49f24a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
23 changes: 12 additions & 11 deletions src/main/java/com/spotify/dns/NoCachingLookupFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,24 @@
package com.spotify.dns;

import com.google.common.base.Preconditions;
import org.xbill.DNS.*;
import org.xbill.DNS.Lookup;


/**
* A LookupFactory that delegates the creation of a lookup then forcing it to not use the cache
*/
public class NoCachingLookupFactory implements LookupFactory {

private final LookupFactory delegate;
private final LookupFactory delegate;

public NoCachingLookupFactory(LookupFactory delegate) {
this.delegate = Preconditions.checkNotNull(delegate, "Delegate lookup factory cannot be null");
}
public NoCachingLookupFactory(LookupFactory delegate) {
this.delegate = Preconditions.checkNotNull(delegate, "Delegate lookup factory cannot be null");
}

@Override
public Lookup forName(String fqdn) {
Lookup lookup = delegate.forName(fqdn);
lookup.setCache(null);
return lookup;
}
@Override
public Lookup forName(String fqdn) {
Lookup lookup = delegate.forName(fqdn);
lookup.setCache(null);
return lookup;
}
}
7 changes: 5 additions & 2 deletions src/test/java/com/spotify/dns/NoCachingLookupFactoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
import org.xbill.DNS.*;
import org.xbill.DNS.DClass;
import org.xbill.DNS.Lookup;
import org.xbill.DNS.Type;

import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;

@RunWith(MockitoJUnitRunner.class)
Expand Down

0 comments on commit f49f24a

Please sign in to comment.