diff --git a/test/firmware_state_notyetstarted_unittest.cpp b/test/firmware_state_notyetstarted_unittest.cpp
index 4d850aa..f662820 100644
--- a/test/firmware_state_notyetstarted_unittest.cpp
+++ b/test/firmware_state_notyetstarted_unittest.cpp
@@ -90,26 +90,22 @@
  */
 TEST_F(FirmwareHandlerNotYetStartedTest, OpenStaticImageFileVerifyStateChange)
 {
-    auto realHandler = dynamic_cast<FirmwareBlobHandler*>(handler.get());
-
     EXPECT_CALL(imageMock, open(staticLayoutBlobId)).WillOnce(Return(true));
 
     EXPECT_TRUE(handler->open(session, flags, staticLayoutBlobId));
-    EXPECT_EQ(FirmwareBlobHandler::UpdateState::uploadInProgress,
-              realHandler->getCurrentState());
+
+    expectedState(FirmwareBlobHandler::UpdateState::uploadInProgress);
 
     EXPECT_TRUE(handler->canHandleBlob(activeImageBlobId));
 }
 
 TEST_F(FirmwareHandlerNotYetStartedTest, OpenHashFileVerifyStateChange)
 {
-    auto realHandler = dynamic_cast<FirmwareBlobHandler*>(handler.get());
-
     EXPECT_CALL(imageMock, open(hashBlobId)).WillOnce(Return(true));
 
     EXPECT_TRUE(handler->open(session, flags, hashBlobId));
-    EXPECT_EQ(FirmwareBlobHandler::UpdateState::uploadInProgress,
-              realHandler->getCurrentState());
+
+    expectedState(FirmwareBlobHandler::UpdateState::uploadInProgress);
 
     EXPECT_TRUE(handler->canHandleBlob(activeHashBlobId));
 }
diff --git a/test/firmware_state_uploadinprogress_unittest.cpp b/test/firmware_state_uploadinprogress_unittest.cpp
index 237fc44..085f542 100644
--- a/test/firmware_state_uploadinprogress_unittest.cpp
+++ b/test/firmware_state_uploadinprogress_unittest.cpp
@@ -44,11 +44,9 @@
   protected:
     void openToInProgress(const std::string& blobId)
     {
-        auto realHandler = dynamic_cast<FirmwareBlobHandler*>(handler.get());
         EXPECT_CALL(imageMock, open(blobId)).WillOnce(Return(true));
         EXPECT_TRUE(handler->open(session, flags, blobId));
-        EXPECT_EQ(FirmwareBlobHandler::UpdateState::uploadInProgress,
-                  realHandler->getCurrentState());
+        expectedState(FirmwareBlobHandler::UpdateState::uploadInProgress);
     }
 
     std::uint16_t session = 1;
@@ -191,19 +189,11 @@
 TEST_F(FirmwareHandlerUploadInProgressTest,
        ClosingImageFileTransitionsToVerificationPending)
 {
-    auto realHandler = dynamic_cast<FirmwareBlobHandler*>(handler.get());
-
     EXPECT_FALSE(handler->canHandleBlob(verifyBlobId));
+    openToInProgress(staticLayoutBlobId);
 
-    EXPECT_CALL(imageMock, open(staticLayoutBlobId)).WillOnce(Return(true));
-
-    EXPECT_TRUE(handler->open(session, flags, staticLayoutBlobId));
-    EXPECT_EQ(FirmwareBlobHandler::UpdateState::uploadInProgress,
-              realHandler->getCurrentState());
-
-    handler->close(1);
-    EXPECT_EQ(FirmwareBlobHandler::UpdateState::verificationPending,
-              realHandler->getCurrentState());
+    handler->close(session);
+    expectedState(FirmwareBlobHandler::UpdateState::verificationPending);
 
     EXPECT_TRUE(handler->canHandleBlob(verifyBlobId));
 }
@@ -211,19 +201,11 @@
 TEST_F(FirmwareHandlerUploadInProgressTest,
        ClosingHashFileTransitionsToVerificationPending)
 {
-    auto realHandler = dynamic_cast<FirmwareBlobHandler*>(handler.get());
-
     EXPECT_FALSE(handler->canHandleBlob(verifyBlobId));
+    openToInProgress(hashBlobId);
 
-    EXPECT_CALL(imageMock, open(hashBlobId)).WillOnce(Return(true));
-
-    EXPECT_TRUE(handler->open(session, flags, hashBlobId));
-    EXPECT_EQ(FirmwareBlobHandler::UpdateState::uploadInProgress,
-              realHandler->getCurrentState());
-
-    handler->close(1);
-    EXPECT_EQ(FirmwareBlobHandler::UpdateState::verificationPending,
-              realHandler->getCurrentState());
+    handler->close(session);
+    expectedState(FirmwareBlobHandler::UpdateState::verificationPending);
 
     EXPECT_TRUE(handler->canHandleBlob(verifyBlobId));
 }
diff --git a/test/firmware_state_verificationcompleted_unittest.cpp b/test/firmware_state_verificationcompleted_unittest.cpp
index f06193e..d514dd0 100644
--- a/test/firmware_state_verificationcompleted_unittest.cpp
+++ b/test/firmware_state_verificationcompleted_unittest.cpp
@@ -49,30 +49,26 @@
         /* The hash was not sent up, as it's technically optional.  Therefore,
          * there is no active hash file.
          */
-        auto realHandler = dynamic_cast<FirmwareBlobHandler*>(handler.get());
         EXPECT_CALL(imageMock, open(staticLayoutBlobId)).WillOnce(Return(true));
         EXPECT_TRUE(handler->open(session, flags, staticLayoutBlobId));
-        EXPECT_EQ(FirmwareBlobHandler::UpdateState::uploadInProgress,
-                  realHandler->getCurrentState());
+        expectedState(FirmwareBlobHandler::UpdateState::uploadInProgress);
+
         EXPECT_CALL(imageMock, close()).WillRepeatedly(Return());
         handler->close(session);
-        EXPECT_EQ(FirmwareBlobHandler::UpdateState::verificationPending,
-                  realHandler->getCurrentState());
+        expectedState(FirmwareBlobHandler::UpdateState::verificationPending);
 
         EXPECT_TRUE(handler->open(session, flags, verifyBlobId));
         EXPECT_CALL(*verifyMockPtr, triggerVerification())
             .WillOnce(Return(true));
 
         EXPECT_TRUE(handler->commit(session, {}));
-        EXPECT_EQ(FirmwareBlobHandler::UpdateState::verificationStarted,
-                  realHandler->getCurrentState());
+        expectedState(FirmwareBlobHandler::UpdateState::verificationStarted);
 
         EXPECT_CALL(*verifyMockPtr, checkVerificationState())
             .WillOnce(Return(checkResponse));
         blobs::BlobMeta meta;
         EXPECT_TRUE(handler->stat(session, &meta));
-        EXPECT_EQ(FirmwareBlobHandler::UpdateState::verificationCompleted,
-                  realHandler->getCurrentState());
+        expectedState(FirmwareBlobHandler::UpdateState::verificationCompleted);
     }
 
     std::uint16_t session = 1;
diff --git a/test/firmware_state_verificationpending_unittest.cpp b/test/firmware_state_verificationpending_unittest.cpp
index 92b6a2a..c42d83e 100644
--- a/test/firmware_state_verificationpending_unittest.cpp
+++ b/test/firmware_state_verificationpending_unittest.cpp
@@ -47,15 +47,13 @@
   protected:
     void getToVerificationPending(const std::string& blobId)
     {
-        auto realHandler = dynamic_cast<FirmwareBlobHandler*>(handler.get());
         EXPECT_CALL(imageMock, open(blobId)).WillOnce(Return(true));
         EXPECT_TRUE(handler->open(session, flags, blobId));
-        EXPECT_EQ(FirmwareBlobHandler::UpdateState::uploadInProgress,
-                  realHandler->getCurrentState());
+        expectedState(FirmwareBlobHandler::UpdateState::uploadInProgress);
+
         EXPECT_CALL(imageMock, close()).WillRepeatedly(Return());
         handler->close(session);
-        EXPECT_EQ(FirmwareBlobHandler::UpdateState::verificationPending,
-                  realHandler->getCurrentState());
+        expectedState(FirmwareBlobHandler::UpdateState::verificationPending);
     }
 
     std::uint16_t session = 1;
@@ -169,13 +167,11 @@
 
     EXPECT_CALL(imageMock, open(staticLayoutBlobId)).WillOnce(Return(true));
     EXPECT_TRUE(handler->open(session, flags, staticLayoutBlobId));
-
-    auto realHandler = dynamic_cast<FirmwareBlobHandler*>(handler.get());
-    EXPECT_EQ(FirmwareBlobHandler::UpdateState::uploadInProgress,
-              realHandler->getCurrentState());
+    expectedState(FirmwareBlobHandler::UpdateState::uploadInProgress);
 
     expectedBlobs.erase(
-        std::remove(expectedBlobs.begin(), expectedBlobs.end(), verifyBlobId));
+        std::remove(expectedBlobs.begin(), expectedBlobs.end(), verifyBlobId),
+        expectedBlobs.end());
 
     /* Verify the active blob ID was not added to the list twice and
      * verifyBlobId is removed
@@ -188,19 +184,17 @@
  * close(session)
  */
 TEST_F(FirmwareHandlerVerificationPendingTest,
-       ClosingVerifyBlobDoesNotChangeState)
+       ClosingVerifyBlobWithoutCommitDoesNotChangeState)
 {
+    /* commit() will change the state, closing post-commit is part of
+     * verificationStarted testing.
+     */
     getToVerificationPending(staticLayoutBlobId);
     EXPECT_TRUE(handler->open(session, flags, verifyBlobId));
-
-    auto realHandler = dynamic_cast<FirmwareBlobHandler*>(handler.get());
-    EXPECT_EQ(FirmwareBlobHandler::UpdateState::verificationPending,
-              realHandler->getCurrentState());
+    expectedState(FirmwareBlobHandler::UpdateState::verificationPending);
 
     handler->close(session);
-
-    EXPECT_EQ(FirmwareBlobHandler::UpdateState::verificationPending,
-              realHandler->getCurrentState());
+    expectedState(FirmwareBlobHandler::UpdateState::verificationPending);
 }
 
 /*
@@ -214,10 +208,7 @@
     EXPECT_CALL(*verifyMockPtr, triggerVerification()).WillOnce(Return(true));
 
     EXPECT_TRUE(handler->commit(session, {}));
-
-    auto realHandler = dynamic_cast<FirmwareBlobHandler*>(handler.get());
-    EXPECT_EQ(FirmwareBlobHandler::UpdateState::verificationStarted,
-              realHandler->getCurrentState());
+    expectedState(FirmwareBlobHandler::UpdateState::verificationStarted);
 }
 
 /*
diff --git a/test/firmware_state_verificationstarted_unittest.cpp b/test/firmware_state_verificationstarted_unittest.cpp
index b09e9ce..e5f57e5 100644
--- a/test/firmware_state_verificationstarted_unittest.cpp
+++ b/test/firmware_state_verificationstarted_unittest.cpp
@@ -44,23 +44,20 @@
   protected:
     void getToVerificationStarted(const std::string& blobId)
     {
-        auto realHandler = dynamic_cast<FirmwareBlobHandler*>(handler.get());
         EXPECT_CALL(imageMock, open(blobId)).WillOnce(Return(true));
         EXPECT_TRUE(handler->open(session, flags, blobId));
-        EXPECT_EQ(FirmwareBlobHandler::UpdateState::uploadInProgress,
-                  realHandler->getCurrentState());
+        expectedState(FirmwareBlobHandler::UpdateState::uploadInProgress);
+
         EXPECT_CALL(imageMock, close()).WillRepeatedly(Return());
         handler->close(session);
-        EXPECT_EQ(FirmwareBlobHandler::UpdateState::verificationPending,
-                  realHandler->getCurrentState());
+        expectedState(FirmwareBlobHandler::UpdateState::verificationPending);
 
         EXPECT_TRUE(handler->open(session, flags, verifyBlobId));
         EXPECT_CALL(*verifyMockPtr, triggerVerification())
             .WillOnce(Return(true));
 
         EXPECT_TRUE(handler->commit(session, {}));
-        EXPECT_EQ(FirmwareBlobHandler::UpdateState::verificationStarted,
-                  realHandler->getCurrentState());
+        expectedState(FirmwareBlobHandler::UpdateState::verificationStarted);
     }
 
     std::uint16_t session = 1;
@@ -104,12 +101,9 @@
     expectedMeta.metadata.push_back(
         static_cast<std::uint8_t>(VerifyCheckResponses::failed));
 
-    auto realHandler = dynamic_cast<FirmwareBlobHandler*>(handler.get());
     EXPECT_TRUE(handler->stat(session, &meta));
     EXPECT_EQ(expectedMeta, meta);
-
-    EXPECT_EQ(FirmwareBlobHandler::UpdateState::verificationCompleted,
-              realHandler->getCurrentState());
+    expectedState(FirmwareBlobHandler::UpdateState::verificationCompleted);
 }
 
 TEST_F(FirmwareHandlerVerificationStartedTest,
@@ -128,12 +122,9 @@
     expectedMeta.metadata.push_back(
         static_cast<std::uint8_t>(VerifyCheckResponses::success));
 
-    auto realHandler = dynamic_cast<FirmwareBlobHandler*>(handler.get());
     EXPECT_TRUE(handler->stat(session, &meta));
     EXPECT_EQ(expectedMeta, meta);
-
-    EXPECT_EQ(FirmwareBlobHandler::UpdateState::verificationCompleted,
-              realHandler->getCurrentState());
+    expectedState(FirmwareBlobHandler::UpdateState::verificationCompleted);
 }
 
 /* TODO: Once verificationCompleted is the state, canHandleBlob should accept
@@ -253,9 +244,7 @@
 {
     getToVerificationStarted(staticLayoutBlobId);
     EXPECT_TRUE(handler->commit(session, {}));
-    auto realHandler = dynamic_cast<FirmwareBlobHandler*>(handler.get());
-    EXPECT_EQ(FirmwareBlobHandler::UpdateState::verificationStarted,
-              realHandler->getCurrentState());
+    expectedState(FirmwareBlobHandler::UpdateState::verificationStarted);
 }
 
 /*
diff --git a/test/firmware_unittest.hpp b/test/firmware_unittest.hpp
index d2eaa2c..2427b82 100644
--- a/test/firmware_unittest.hpp
+++ b/test/firmware_unittest.hpp
@@ -33,6 +33,12 @@
             blobs, data, std::move(verifyMock), CreateUpdateMock());
     }
 
+    void expectedState(FirmwareBlobHandler::UpdateState state)
+    {
+        auto realHandler = dynamic_cast<FirmwareBlobHandler*>(handler.get());
+        EXPECT_EQ(state, realHandler->getCurrentState());
+    }
+
     ImageHandlerMock imageMock;
     std::vector<HandlerPack> blobs;
     std::vector<DataHandlerPack> data = {
