Skip to content

Commit

Permalink
src: dont use guava's Sets
Browse files Browse the repository at this point in the history
Less dependency on guava

Acked-by: Lea Morschel
Target: master
  • Loading branch information
kofemann committed Jan 18, 2022
1 parent 5541044 commit 7a091ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.dcache.nfs.v4;

import com.google.common.collect.Sets;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.URISyntaxException;
import java.util.EnumSet;
import java.util.Optional;
import org.dcache.nfs.ExportFile;
import org.dcache.nfs.v4.xdr.fattr4_fs_layout_types;
Expand Down Expand Up @@ -33,7 +33,7 @@ public void testDefaultLayoutType() throws IOException, URISyntaxException {
RpcTransport transport = mock(RpcTransport.class);
ExportFile exportFile = new ExportFile(ClassLoader.getSystemResource("org/dcache/nfs/exports").toURI());

given(dm.getLayoutTypes()).willReturn(Sets.newHashSet(layouttype4.values()));
given(dm.getLayoutTypes()).willReturn(EnumSet.allOf(layouttype4.class));
given(transport.getRemoteSocketAddress()).willReturn(new InetSocketAddress("172.16.4.1", 0));

given(call.getCredential()).willReturn(new RpcAuthTypeNone());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package org.dcache.nfs.v4;

import com.google.common.collect.Sets;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.EnumSet;

import org.dcache.nfs.v4.xdr.COMPOUND4args;
import org.dcache.nfs.v4.xdr.COMPOUND4res;
import org.dcache.nfs.v4.xdr.device_addr4;
Expand Down Expand Up @@ -30,7 +31,7 @@ public void testNotificationBitmapSize() throws IOException, URISyntaxException
NFSv41DeviceManager dm = mock(NFSv41DeviceManager.class);
given(dm.getDeviceInfo(any(), any())).willReturn(mock(device_addr4.class));

given(dm.getLayoutTypes()).willReturn(Sets.newHashSet(layouttype4.values()));
given(dm.getLayoutTypes()).willReturn(EnumSet.allOf(layouttype4.class));
CompoundContext context = new CompoundContextBuilder()
.withDeviceManager(dm)
.withCall(generateRpcCall())
Expand Down

0 comments on commit 7a091ba

Please sign in to comment.