Skip to content

Commit 1708170

Browse files
committed
Checstyle errors
1 parent 20ad049 commit 1708170

File tree

2 files changed

+56
-49
lines changed

2 files changed

+56
-49
lines changed

hbase-server/src/test/java/org/apache/hadoop/hbase/keymeta/TestManagedKeymeta.java

Lines changed: 54 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -122,43 +122,47 @@ public void testEnableKeyManagementWithExceptionOnGetManagedKey() throws Excepti
122122

123123
@Test
124124
public void testEnableKeyManagementWithClientSideServiceException() throws Exception {
125-
doTestWithClientSideServiceException((mockStub, networkError) -> {
126-
try {
127-
when(mockStub.enableKeyManagement(any(), any())).thenThrow(networkError);
128-
} catch (ServiceException e) {
129-
// We are just setting up the mock, so no exception is expected here.
130-
throw new RuntimeException("Unexpected ServiceException", e);
131-
}
132-
return null;
133-
}, (client) -> {
134-
try {
135-
client.enableKeyManagement("cust", "namespace");
136-
} catch (IOException e) {
137-
throw new RuntimeException(e);
138-
}
139-
return null;
140-
});
125+
doTestWithClientSideServiceException(
126+
(mockStub, networkError) -> {
127+
try {
128+
when(mockStub.enableKeyManagement(any(), any())).thenThrow(networkError);
129+
} catch (ServiceException e) {
130+
// We are just setting up the mock, so no exception is expected here.
131+
throw new RuntimeException("Unexpected ServiceException", e);
132+
}
133+
return null;
134+
},
135+
(client) -> {
136+
try {
137+
client.enableKeyManagement("cust", "namespace");
138+
} catch (IOException e) {
139+
throw new RuntimeException(e);
140+
}
141+
return null;
142+
});
141143
}
142144

143145
@Test
144146
public void testGetManagedKeysWithClientSideServiceException() throws Exception {
145147
// Similar test for getManagedKeys method
146-
doTestWithClientSideServiceException((mockStub, networkError) -> {
147-
try {
148-
when(mockStub.getManagedKeys(any(), any())).thenThrow(networkError);
149-
} catch (ServiceException e) {
150-
// We are just setting up the mock, so no exception is expected here.
151-
throw new RuntimeException("Unexpected ServiceException", e);
152-
}
153-
return null;
154-
}, (client) -> {
155-
try {
156-
client.getManagedKeys("cust", "namespace");
157-
} catch (IOException | KeyException e) {
158-
throw new RuntimeException(e);
159-
}
160-
return null;
161-
});
148+
doTestWithClientSideServiceException(
149+
(mockStub, networkError) -> {
150+
try {
151+
when(mockStub.getManagedKeys(any(), any())).thenThrow(networkError);
152+
} catch (ServiceException e) {
153+
// We are just setting up the mock, so no exception is expected here.
154+
throw new RuntimeException("Unexpected ServiceException", e);
155+
}
156+
return null;
157+
},
158+
(client) -> {
159+
try {
160+
client.getManagedKeys("cust", "namespace");
161+
} catch (IOException | KeyException e) {
162+
throw new RuntimeException(e);
163+
}
164+
return null;
165+
});
162166
}
163167

164168
@Test
@@ -213,22 +217,24 @@ public void testRotateSTKWithExceptionOnGetSystemKey() throws Exception {
213217

214218
@Test
215219
public void testRotateSTKWithClientSideServiceException() throws Exception {
216-
doTestWithClientSideServiceException((mockStub, networkError) -> {
217-
try {
218-
when(mockStub.rotateSTK(any(), any())).thenThrow(networkError);
219-
} catch (ServiceException e) {
220-
// We are just setting up the mock, so no exception is expected here.
221-
throw new RuntimeException("Unexpected ServiceException", e);
222-
}
223-
return null;
224-
}, (client) -> {
225-
try {
226-
client.rotateSTK();
227-
} catch (IOException e) {
228-
throw new RuntimeException(e);
229-
}
230-
return null;
231-
});
220+
doTestWithClientSideServiceException(
221+
(mockStub, networkError) -> {
222+
try {
223+
when(mockStub.rotateSTK(any(), any())).thenThrow(networkError);
224+
} catch (ServiceException e) {
225+
// We are just setting up the mock, so no exception is expected here.
226+
throw new RuntimeException("Unexpected ServiceException", e);
227+
}
228+
return null;
229+
},
230+
(client) -> {
231+
try {
232+
client.rotateSTK();
233+
} catch (IOException e) {
234+
throw new RuntimeException(e);
235+
}
236+
return null;
237+
});
232238
}
233239

234240
private void

hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestKeymetaMockProviderShell.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ public class TestKeymetaMockProviderShell extends ManagedKeyTestBase implements
3838
private final ScriptingContainer jruby = new ScriptingContainer();
3939

4040
@Before
41+
@Override
4142
public void setUp() throws Exception {
42-
final Configuration conf = TEST_UTIL.getConfiguration();
4343
// Enable to be able to debug without timing out.
44+
// final Configuration conf = TEST_UTIL.getConfiguration();
4445
// conf.set("zookeeper.session.timeout", "6000000");
4546
// conf.set("hbase.rpc.timeout", "6000000");
4647
// conf.set("hbase.rpc.read.timeout", "6000000");

0 commit comments

Comments
 (0)