Interface UploadFileFT<E extends dev.daymor.sakuraboot.DataPresentation<I>,I extends Comparable<? super I> & Serializable>

Type Parameters:
E - The entity type DataPresentation.
I - The ID of type Comparable and Serializable.
All Superinterfaces:
dev.daymor.sakuraboot.test.BasicTest<E,I>, dev.daymor.sakuraboot.test.file.api.SuperFileTest<E,I>, SuperFT<E,I>, dev.daymor.sakuraboot.test.SuperIT<E,I>, dev.daymor.sakuraboot.test.SuperTest<I>
All Known Subinterfaces:
FileFT<E,I>

public interface UploadFileFT<E extends dev.daymor.sakuraboot.DataPresentation<I>,I extends Comparable<? super I> & Serializable> extends SuperFT<E,I>, dev.daymor.sakuraboot.test.file.api.SuperFileTest<E,I>
The interface for upload file functional tests.

Example:

To create a concrete test class that inherits from UploadFileFT, follow these steps:

Implements the UploadFileFT class:

 public class YourFT //
     implements UploadFileFT<YourEntity, YourIdType> {

     private final YourUtil util;

     private final ApplicationContext applicationContext;

     private final ObjectMapper objectMapper;

     @LocalServerPort
     private int port;

     @Autowired
     YourFT(
         final YourUtil util, final ApplicationContext applicationContext,
         final ObjectMapper objectMapper) {

         this.util = util;
         this.applicationContext = applicationContext;
         this.objectMapper = objectMapper;
     }

     @Override
     public YourUtil getUtil() {

         return util;
     }

     @Override
     public ApplicationContext getApplicationContext() {

         return applicationContext;
     }

     @Override
     public ObjectMapper getObjectMapper() {

         return objectMapper;
     }

     @Override
     public int getPort() {

         return port;
     }
 }
 
Since:
0.1.2
See Also:
  • Field Details

  • Method Details

    • testUploadFile

      @Test @DisplayName("GIVEN a valid ID and fileFieldName, WHEN uploading a file, THEN the controller should return a valid response with a text message") default void testUploadFile()
    • testUploadFileWithNoFileAndContentType

      @Test @DisplayName("GIVEN no file and content type, WHEN uploading a file, THEN the controller shouldn\'t upload and return an error response") default void testUploadFileWithNoFileAndContentType()
    • testUploadFileWithNoFile

      @Test @DisplayName("GIVEN no file, WHEN uploading a file, THEN the controller shouldn\'t upload and return an error response") default void testUploadFileWithNoFile()