Interface PatchByIdFT<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:
SuperFT<E,I>, dev.daymor.sakuraboot.test.SuperIT<E,I>, dev.daymor.sakuraboot.test.SuperTest<I>
All Known Subinterfaces:
BasicFT<E,I>, CriteriaFT<E,I,F>

public interface PatchByIdFT<E extends dev.daymor.sakuraboot.DataPresentation<I>,I extends Comparable<? super I> & Serializable> extends SuperFT<E,I>
The interface for patch by id functional tests.

Example:

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

Implements the PatchByIdFT class:

 public class YourFT //
     implements PatchByIdFT<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.0
See Also:
  • Method Details

    • testPatchById

      @Test @DisplayName("GIVEN a valid ID and partial entity, WHEN patching by ID, THEN the controller should patch and return a valid response with the patched entity") default void testPatchById() throws Exception
      Throws:
      Exception
    • testPatchByIdWithNoEntityAndContentType

      @Test @DisplayName("GIVEN no entity and content type, WHEN patching by ID, THEN the controller shouldn\'t patch and return an error response") default void testPatchByIdWithNoEntityAndContentType()
    • testPatchByIdWithNoEntity

      @Test @DisplayName("GIVEN no entity, WHEN patch by ID, THEN the controller shouldn\'t patch and return an error response") default void testPatchByIdWithNoEntity()
    • testPatchByIdWithEmptyEntity

      @Test @DisplayName("GIVEN an empty entity, WHEN patching by ID, THEN the controller should patch and return a valid response with the patched object") default void testPatchByIdWithEmptyEntity() throws Exception
      Throws:
      Exception