title: Spring boot how to exclude certain class from testing
body: <p>I have implemented own class for representing of database vector data based on UserType class. </p>
  
  <p>My example:</p>
  
  <pre><code>class MyVectorType implements UserType {
  @Override
      public int[] sqlTypes() {
          return new int[] { Types.ARRAY };
      }
  };
  
  @Entity
  @Table("MY_ENTITY")
  public class MyEntity {
      private MyVectorType myVectorType;
  
  }
  </code></pre>
  
  <p>However this class cannot be used in testing with h2 dialect ie. in memory database. There is error: No Dialect mapping for JDBC type: 2003.</p>
  
  <p>Therefore I would like to exclude this entity (inc. repository) from testing but this does not work:</p>
  
  <pre><code>@SpringBootApplication
  @ComponentScan(excludeFilters = {
          @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {
                  MyEntity.class, MyEntityRepository.class})
  })
  public class ApiApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(ApiApplication.class, args);
      }
  }
  </code></pre>
  
  <p>What is wrong or is there any best practice solving this problem?</p>
  
  <p><strong>EDIT 1:</strong> fixed examples - added correct entity and repository</p>
  
  <p><strong>SOLUTION 1:</strong>
  I think that the only possible solution for this moment is move entity classes (which needs to be excluded) to other package. Then set @EntityScan to scan just non-excluded package. Exclude filters in ComponentScan seems to work only in case of @Component classes, not @Entity. However this is not absolutely best practice to solve this problem.</p>