title: How can I validate the data type of the spark DataFrame column programmatically ?
body: <p>I have created a Unit Test in IntelliJ for a function which is doing the type casting. So in my unit test, I want to validate using <code>assert</code> statement as following : </p>
  
  <pre><code>assert(testDF.select(col1).dataType == Integer)
  </code></pre>
  
  <p>So if the above assert statement satisfies the unit test will be success.</p>
  
  <p>Can anyone please help on this ?</p>