test_class.declarator: noOpLockedResourceRepository
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private NoOpLockedResourceRepository noOpLockedResourceRepository;
test_class.type: NoOpLockedResourceRepository
test_class.var_name: noOpLockedResourceRepository
test_class.declarator: preparationRepository
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private PreparationRepository preparationRepository;
test_class.type: PreparationRepository
test_class.var_name: preparationRepository
test_class.file: dataprep-backend-service/src/test/java/org/talend/dataprep/lock/store/NoOpLockedResourceRepositoryTest.java
test_class.identifier: NoOpLockedResourceRepositoryTest
test_case.body: @Test
      public void tryLock() {
          // given
          String preparationId = "preparation id";
          PersistentPreparation preparationMock = mock(PersistentPreparation.class);
          when(preparationRepository.get(preparationId, PersistentPreparation.class)).thenReturn(preparationMock);
  
          // when
          PersistentPreparation preparation =
                  noOpLockedResourceRepository.tryLock(preparationId, "Toto", "toto de Charleville-Mézières");
  
          // then
          assertEquals(preparationMock, preparation);
          verify(preparationRepository).get(preparationId, PersistentPreparation.class);
      }
test_case.class_method_signature: NoOpLockedResourceRepositoryTest.tryLock()
test_case.full_signature: @Test public void tryLock()
test_case.identifier: tryLock
test_case.invocations: mock thenReturn when get tryLock assertEquals get verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void tryLock()
focal_class.declarator: LOGGER = getLogger(NoOpLockedResourceRepository.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = getLogger(NoOpLockedResourceRepository.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: preparationRepository
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private PreparationRepository preparationRepository;
focal_class.type: PreparationRepository
focal_class.var_name: preparationRepository
focal_class.file: dataprep-backend-service/src/main/java/org/talend/dataprep/lock/store/NoOpLockedResourceRepository.java
focal_class.identifier: NoOpLockedResourceRepository
focal_class.interfaces: implements LockedResourceRepository
focal_class.class_method_signature: NoOpLockedResourceRepository.NoOpLockedResourceRepository()
focal_class.full_signature: public  NoOpLockedResourceRepository()
focal_class.identifier: NoOpLockedResourceRepository
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  NoOpLockedResourceRepository()
focal_class.class_method_signature: NoOpLockedResourceRepository.tryLock(String preparationId, String userId, String displayName)
focal_class.full_signature: @Override public PersistentPreparation tryLock(String preparationId, String userId, String displayName)
focal_class.identifier: tryLock
focal_class.modifiers: @Override public
focal_class.parameters: (String preparationId, String userId, String displayName)
focal_class.return: PersistentPreparation
focal_class.signature: PersistentPreparation tryLock(String preparationId, String userId, String displayName)
focal_class.class_method_signature: NoOpLockedResourceRepository.unlock(String preparationId, String userId)
focal_class.full_signature: @Override public void unlock(String preparationId, String userId)
focal_class.identifier: unlock
focal_class.modifiers: @Override public
focal_class.parameters: (String preparationId, String userId)
focal_class.return: void
focal_class.signature: void unlock(String preparationId, String userId)
focal_method.body: @Override
      public PersistentPreparation tryLock(String preparationId, String userId, String displayName) {
          PersistentPreparation preparation = preparationRepository.get(preparationId, PersistentPreparation.class);
          if (preparation == null) {
              throw new TDPException(PREPARATION_DOES_NOT_EXIST, build().put("id", preparationId));
          }
          return preparation;
      }
focal_method.class_method_signature: NoOpLockedResourceRepository.tryLock(String preparationId, String userId, String displayName)
focal_method.full_signature: @Override public PersistentPreparation tryLock(String preparationId, String userId, String displayName)
focal_method.identifier: tryLock
focal_method.invocations: get put build
focal_method.modifiers: @Override public
focal_method.parameters: (String preparationId, String userId, String displayName)
focal_method.return: PersistentPreparation
focal_method.signature: PersistentPreparation tryLock(String preparationId, String userId, String displayName)