Skip to content

Commit

Permalink
Improve imports
Browse files Browse the repository at this point in the history
  • Loading branch information
cromoteca committed Jan 27, 2025
1 parent 7f55b92 commit de748d3
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.vaadin.hilla;

import java.io.ByteArrayInputStream;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
Expand All @@ -17,6 +15,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
Expand All @@ -30,7 +29,6 @@
import java.util.stream.Stream;

import com.vaadin.hilla.engine.EngineConfiguration;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
Expand Down Expand Up @@ -80,7 +78,6 @@
import jakarta.annotation.security.PermitAll;
import jakarta.annotation.security.RolesAllowed;
import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.constraints.Min;
Expand Down Expand Up @@ -468,8 +465,7 @@ public void should_NotCallMethod_When_DenyAll() {
}

@Test
public void should_AcceptMultipartFile()
throws IOException, ServletException {
public void should_AcceptMultipartFile() throws IOException {
var request = mock(MultipartHttpServletRequest.class);
when(request.getUserPrincipal()).thenReturn(mock(Principal.class));
when(request.getHeader("X-CSRF-Token")).thenReturn("Vaadin Fusion");
Expand All @@ -494,7 +490,7 @@ public void should_AcceptMultipartFile()
new Cookie(ApplicationConstants.CSRF_TOKEN, "Vaadin Fusion") });

var vaadinController = createVaadinController(TEST_ENDPOINT);

var response = vaadinController.serveMultipartEndpoint(
TEST_ENDPOINT_NAME, "checkFileLength1", request, null);
assertEquals(HttpStatus.OK, response.getStatusCode());
Expand Down

0 comments on commit de748d3

Please sign in to comment.