Skip to content

Commit

Permalink
test(recordingoptions): rename variables
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Aug 10, 2021
1 parent e56bcb1 commit 94fbfd2
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,16 @@ void shouldHaveExpectedRequiredPermissions() {

@Test
void shouldSetRecordingOptions() throws Exception {
Map<String, String> defaultValues =
Map<String, String> originalValues =
Map.of("toDisk", "true", "maxAge", "50", "maxSize", "32");
Mockito.when(recordingOptionsBuilderFactory.create(Mockito.any())).thenReturn(builder);
Mockito.when(builder.build()).thenReturn(recordingOptions);
Mockito.when(recordingOptions.get("toDisk")).thenReturn(defaultValues.get("toDisk"));
Mockito.when(recordingOptions.get("maxAge")).thenReturn(defaultValues.get("maxAge"));
Mockito.when(recordingOptions.get("maxSize")).thenReturn(defaultValues.get("maxSize"));
Mockito.when(recordingOptions.get("toDisk")).thenReturn(originalValues.get("toDisk"));
Mockito.when(recordingOptions.get("maxAge")).thenReturn(originalValues.get("maxAge"));
Mockito.when(recordingOptions.get("maxSize")).thenReturn(originalValues.get("maxSize"));

MultiMap requestAttrs = MultiMap.caseInsensitiveMultiMap();
requestAttrs.addAll(defaultValues);
requestAttrs.addAll(originalValues);

Mockito.when(
connectionManager.executeConnectedTask(
Expand Down Expand Up @@ -161,13 +161,13 @@ public Map answer(InvocationOnMock args) throws Throwable {

@Test
void shouldUnsetRecordingOptions() throws Exception {
Map<String, String> defaultValues =
Map<String, String> originalValues =
Map.of("toDisk", "true", "maxAge", "50", "maxSize", "32");
Mockito.when(recordingOptionsBuilderFactory.create(Mockito.any())).thenReturn(builder);
Mockito.when(builder.build()).thenReturn(recordingOptions);
Mockito.when(recordingOptions.get("toDisk")).thenReturn(defaultValues.get("toDisk"));
Mockito.when(recordingOptions.get("maxAge")).thenReturn(defaultValues.get("maxAge"));
Mockito.when(recordingOptions.get("maxSize")).thenReturn(defaultValues.get("maxSize"));
Mockito.when(recordingOptions.get("toDisk")).thenReturn(originalValues.get("toDisk"));
Mockito.when(recordingOptions.get("maxAge")).thenReturn(originalValues.get("maxAge"));
Mockito.when(recordingOptions.get("maxSize")).thenReturn(originalValues.get("maxSize"));

MultiMap requestAttrs = MultiMap.caseInsensitiveMultiMap();
requestAttrs.addAll(Map.of("toDisk", "unset", "maxAge", "unset", "maxSize", "unset"));
Expand Down Expand Up @@ -207,9 +207,9 @@ public Map answer(InvocationOnMock args) throws Throwable {

@ParameterizedTest
@MethodSource("getRequestMaps")
void shouldThrowInvalidOptionException(Map<String, String> defaultValues) throws Exception {
void shouldThrowInvalidOptionException(Map<String, String> values) throws Exception {
MultiMap requestAttrs = MultiMap.caseInsensitiveMultiMap();
requestAttrs.addAll(defaultValues);
requestAttrs.addAll(values);

RoutingContext ctx = Mockito.mock(RoutingContext.class);
HttpServerRequest req = Mockito.mock(HttpServerRequest.class);
Expand Down

0 comments on commit 94fbfd2

Please sign in to comment.