{"id":345808,"date":"2023-02-23T15:01:59","date_gmt":"2023-02-23T15:01:59","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=345808"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2023-02-23T15:01:59","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=345808","title":{"rendered":"<span>\u041a\u0430\u043a \u043c\u044b \u0438\u0433\u0440\u0430\u043b\u0438 \u0432 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 Groovy \u0438 \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u043b\u0438<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0443 \u043c\u0435\u043d\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d \u0432\u043e\u043f\u0440\u043e\u0441 \u043a \u0442\u0435\u0431\u0435 \u0434\u043e\u0440\u043e\u0433\u043e\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c. \u041a\u043e\u0434\u0438\u043b \u043b\u0438 \u0442\u044b \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c unit \u0442\u0435\u0441\u0442\u044b \u043d\u0430 Groovy ? \u0415\u0441\u043b\u0438 \u0442\u0432\u043e\u044f \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0430\u043d\u0434\u0440\u043e\u0438\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u043c\u0430\u043b\u0430. \u0418 \u044f \u0441 \u0442\u0430\u043a\u0438\u043c \u043d\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0434\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0410\u043b\u044c\u0444\u044b.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0442\u044b \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0448\u044c \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0432\u0438\u0434\u0438\u0448\u044c \u0442\u0430\u043a\u043e\u0439 \u0442\u0435\u0441\u0442: <\/p>\n<pre><code class=\"ruby\">class InvestmentsInstrumentsRepositorySpec extends Specification {      @ClassRule     @Shared     RxJavaRule rxJavaRule      def service = Mock(InvestmentsInstrumentsService)     def repository = new InvestmentsInstrumentsRepository(service)      def 'should call service and return proper response'() {         given:             def expectedResponse = InvestmentsInstrumentsTestDataKt.getInvestmentsInstrumentsResponse()         when:             def observer = repository.getInstruments().test()         then:             1 * service.getInvestmentsInstruments() >> Single.just(expectedResponse)             observer.assertValue(expectedResponse)     } }<\/code><\/pre>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0443 \u0442\u0430\u0438\u0442\u044c, \u043c\u043e\u044f \u0440\u0435\u0430\u043a\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1ff\/1a8\/700\/1ff1a8700bce148a748168bebec39586.png\" alt=\" \" title=\" \" width=\"1794\" height=\"1552\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1ff\/1a8\/700\/1ff1a8700bce148a748168bebec39586.png\"\/><figcaption> <\/figcaption><\/figure>\n<p>\u041d\u043e \u0434\u0430\u0432\u0430\u0439 \u043f\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u043e\u043c\u0438\u0434\u043e\u0440\u044b \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0438 \u0434\u0430\u0434\u0438\u043c \u0448\u0430\u043d\u0441 \u0442\u0430\u043a\u043e\u043c\u0443 \u0442\u0435\u0441\u0442\u0443. <\/p>\n<p><strong>\u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c\u0441\u044f, \u0432 \u0446\u0435\u043b\u043e\u043c, \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0433\u043e \u0432 \u043d\u0451\u043c \u043d\u0435\u0442.<\/strong> \u042d\u0442\u043e \u0442\u0435\u0441\u0442 \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u043a\u0430\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0447\u0442\u043e \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0434\u0435\u0440\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043c\u043e\u043a\u0430. \u041f\u0440\u0438\u0447\u0435\u043c \u0442\u0435\u0441\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e, \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u043c\u0435\u0442\u043a\u0438 given\/when\/then (\u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u0430 \u0441\u0447\u0451\u0442 \u0447\u0435\u0433\u043e \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442).<\/p>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0442\u0435\u0441\u0442 \u043d\u0430 JUnit 5, \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"kotlin\">@ExtendWith(RxJavaExtension::class) class InvestmentsInstrumentsRepositoryTest {      private val service = mockk&lt;InvestmentsInstrumentsService>()     private val repository = InvestmentsInstrumentsRepository(service)      @Test     fun `should call service and return proper response`() {         \/\/ given         val expectedResponse = getInvestmentsInstrumentsResponse()         every { service.getInvestmentsInstruments() } returns Single.just(expectedResponse)         \/\/ when         val observer = repository.getInstruments().test()         \/\/ then         verify(exactly = 1) { service.getInvestmentsInstruments() }         observer.assertResult(expectedResponse)     } }<\/code><\/pre>\n<p>\u041f\u043e\u043a\u0430 \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043c\u0435\u0442\u043a\u0430\u043c\u0438 given\/when\/then \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u0438\u044f\u0442\u043d\u043e, \u043d\u043e \u0434\u0430\u0432\u0430\u0439 \u043f\u043e\u0439\u0434\u0451\u043c \u0434\u0430\u043b\u044c\u0448\u0435. <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430 Groovy \u0443 \u043d\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/github.com\/spockframework\/spock\">Spock<\/a>. Spock \u043a\u0430\u043a \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0434\u0432\u0438\u0436\u043e\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 JUnit, \u043f\u0440\u0438\u0447\u0451\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 2.x \u044d\u0442\u043e \u0443\u0436\u0435 JUnit 5. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 JUnit 4. <\/p>\n<p><strong>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043e\u043f\u0440\u043e\u0441 \u2014 \u0441\u043b\u044b\u0448\u0430\u043b \u043b\u0438 \u0442\u044b \u043f\u0440\u043e Data Driven Testing ?<\/strong> \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043f\u0440\u0438\u043c\u0435\u0440: <\/p>\n<pre><code class=\"ruby\">@Unroll     def 'should call paymentsMediator startActivity'() {         given:             featureToggle.isDisabled(Feature.REDESIGN) >> REDESIGN_TOGGLE             featureToggle.isDisabled(Feature.WIDGET_PAYMENT_HUB) >> PAYMENT_TOGGLE         when:             router.openPayScreen(expectedAccountNumber)         then:             1 * paymentsMediator.startActivity(*_) >> { activity, actualAccountNumber ->                 assert actualAccountNumber == expectedAccountNumber             }         where:             REDESIGN_TOGGLE | PAYMENT_TOGGLE             false           | true             true            | false             false           | false     }<\/code><\/pre>\n<p>\u0418 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440: <\/p>\n<pre><code class=\"ruby\">@Unroll     def 'should map unread count and reports to common items list'() {         when:             def actualMappedData = mapper.map(                     AccountStatementsTestDataKt.getReportsListResponse(),                     unreadCountResponse             )         then:             actualMappedData == expectedMappedData         where:             unreadCountResponse                                          | expectedMappedData             AccountStatementsTestDataKt.gerUnreadCountResponseWithZero() | AccountStatementsTestDataKt.getBaseItemsListWithZeroCount()             AccountStatementsTestDataKt.gerUnreadCountResponse()         | AccountStatementsTestDataKt.getBaseItemsListWithOneCount()     }<\/code><\/pre>\n<p><strong>\u0422\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438<\/strong>. \u0412 \u0431\u043b\u043e\u043a\u0435 <code>where:<\/code>  \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u0442\u0435\u0441\u0442 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0438\u0437 \u044d\u0442\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. <\/p>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u0434\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043c \u043d\u0435 \u043d\u0430\u0434\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u0441\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f. \u0422\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432 \u043e\u0434\u0438\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442. \u0418 \u0432 \u0421\u043f\u043e\u043a\u0435, \u043a\u0430\u043a \u0442\u044b \u0432\u0438\u0434\u0438\u0448\u044c, \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e. \u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043c\u043e\u0436\u0435\u0448\u044c \u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0433\u043e\u043b\u043e\u043c JUnit 4 \u0438\u043b\u0438 JUnit 5. \u0421\u043f\u043e\u0439\u043b\u0435\u0440 \u2014 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e :<\/p>\n<pre><code class=\"kotlin\">object ProvideAccountStatusNotClosed : ArgumentsProvider {          override fun provideArguments(context: ExtensionContext?): Stream&lt;out Arguments> {             return TestParamsUtils.getParams&lt;BrokerageAccountStatusesResponse>(                 InvestmentsDocumentsTestData.createBrokerageAccountStatusOpenResponse(),                 InvestmentsDocumentsTestData.createBrokerageAccountStatusPendingResponse(),                 InvestmentsDocumentsTestData.createBrokerageAccountStatusErrorResponse(),                 InvestmentsDocumentsTestData.createBrokerageAccountStatusUnknownResponse(),             )         }     }      @ParameterizedTest     @ArgumentsSource(ProvideAccountStatusNotClosed::class)     fun `should load documents if brokerage account not closed`(expectedStatusResponse: BrokerageAccountStatusesResponse) {         \/\/ when         presenter.onViewCreated()         \/\/ then         verify(exactly = 1) { mapper.prepareDocModelsList(expectedDocsResponse) }     }<\/code><\/pre>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u043f\u043e\u044d\u0442\u0438\u0447\u043d\u043e, \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0441\u044c. <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439 \u0435\u0449\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043a\u0435\u0439\u0441\u043e\u0432. \u042d\u0442\u043e \u044f \u0435\u0449\u0435 \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044e \u043e\u0431 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u043c \u0438\u043c\u0435\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u043c \u0442\u0435\u0441\u0442 \u043a\u043b\u0430\u0441\u0441\u0435. \u0410 \u0442\u0430\u043a\u0436\u0435 \u044f \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 JUnit 4 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0434\u0435\u043b\u0430 \u043e\u0431\u0441\u0442\u043e\u044f\u0442 \u0435\u0449\u0451 \u0445\u0443\u0436\u0435. <\/p>\n<p>\u0418 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0444\u0430\u043a\u0442, <strong>\u0443 \u043d\u0430\u0441 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 3 \u0442\u044b\u0441\u044f\u0447\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432.<\/strong> <\/p>\n<p>\u041d\u043e \u0443 \u0442\u0435\u0431\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441. \u00ab\u0412\u043e\u0442 \u0430\u0432\u0442\u043e\u0440 \u0442\u043e\u043b\u044c\u043a\u043e \u0438 \u0434\u0435\u043b\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0430\u0445\u0432\u0430\u043b\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 Groovy, \u0432 \u0447\u0451\u043c \u0436\u0435 \u043e\u043d \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u043b?\u00bb<\/p>\n<p>\u041d\u0435 \u0442\u043e\u0440\u043e\u043f\u0438\u0441\u044c, \u0441\u0435\u0439\u0447\u0430\u0441 \u044f \u0432\u0441\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u044f \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u043d\u0430 Groovy \ud83d\ude42<\/p>\n<h2>\u041c\u0438\u043d\u0443\u0441 \u21161 <\/h2>\n<p>\u0412\u0441\u0451 \u043b\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u0435 ? <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/08e\/f27\/697\/08ef27697a4838c44254874717a79a57.png\" width=\"3284\" height=\"1886\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/08e\/f27\/697\/08ef27697a4838c44254874717a79a57.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a, \u0447\u0442\u043e \u0432\u0441\u0451 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u0441\u0442\u0443\u0434\u0438\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u043d\u0435 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442. \u041d\u043e \u0434\u0430\u0432\u0430\u0439 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c: <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/706\/fd8\/0da\/706fd80da6bca3aa1a517e83811d3e1c.png\" width=\"3336\" height=\"508\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/706\/fd8\/0da\/706fd80da6bca3aa1a517e83811d3e1c.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0432 \u0447\u0435\u043c \u0436\u0435 \u0434\u0435\u043b\u043e? \u0410 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <strong>\u0432 Groovy \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f<\/strong>. \u042d\u0442\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438 \u043e\u0433\u0440\u043e\u043c\u043d\u0430\u044f \u0441\u0438\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043f\u0440\u043e\u043a\u043b\u044f\u0442\u044c\u0435. <\/p>\n<p>\u041d\u043e \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d workaround, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e <a class=\"mention\" href=\"\/users\/compilestatic\">@CompileStatic<\/a>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/392\/ff4\/30e\/392ff430eb8a1c30636dec535c00db88.png\" width=\"3384\" height=\"1500\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/392\/ff4\/30e\/392ff430eb8a1c30636dec535c00db88.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041c\u044b \u0437\u0430\u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442 \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041d\u043e \u044d\u0442\u0443 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u0432\u0441\u0435\u0445 \u0442\u0435\u0441\u0442\u0430\u0445, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0430 \u0443\u0431\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0438\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u0432\u044b\u0448\u0435. \u0415\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u043e\u0434\u0430 \u043c\u0430\u0440\u043a\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u0442\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0448\u044c \u043f\u043e\u043d\u044f\u0442\u044c \u0432 \u0447\u0451\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u044b\u0448\u0435 \u0441\u0442\u0440\u0435\u043b\u044f\u0435\u0442 \u0447\u0430\u0441\u0442\u043e, \u0434\u0430\u0436\u0435 \u0443 \u0442\u0435\u0445, \u043a\u0442\u043e \u0443\u0436\u0435 \u043f\u0440\u0438\u0432\u044b\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u043d\u0430 Groovy. <strong>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c, \u043f\u0435\u0440\u0432\u044b\u0439 \u0434\u0435\u043d\u044c \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438 \u0442\u0435\u0431\u044f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b.<\/strong> \u0413\u043e\u0442\u043e\u0432 \u043f\u043e\u0441\u043f\u043e\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0448\u0438\u0448\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u043f\u0440\u0435\u0436\u0434\u0435, \u0447\u0435\u043c \u0442\u0435\u0441\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f.  \u0414\u0430 \u0438 \u044f \u0435\u0449\u0451 \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435 \u043d\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0435\u0439 \u043a\u043e\u0433\u0434\u0430 \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442 \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u00ab\u0414\u0430 \u0432\u044b \u0447\u0442\u043e, \u0443\u00a0\u0432\u0430\u0441 \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u00a0Groovy!! \u041a\u0430\u043a\u00a0\u0437\u0434\u043e\u0440\u043e\u0432\u043e, \u0443\u00a0\u043c\u0435\u043d\u044f \u043a\u0430\u043a\u00a0\u0440\u0430\u0437 \u043c\u043d\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u0432\u00a0\u0442\u0430\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445!\u00bb \u0422\u043e \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<h2>\u041c\u0438\u043d\u0443\u0441 \u21162<\/h2>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442, \u0433\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0437 Android (\u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442) \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c robolectric. \u0414\u043b\u044f Spock \u0435\u0441\u0442\u044c \u043e\u0431\u0432\u044f\u0437\u043a\u0430 \u0432\u043e\u043a\u0440\u0443\u0433 robolectric, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f electricspock. <\/p>\n<p>\u0412\u0438\u0434\u0438\u0448\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u043d\u0438\u0436\u0435?<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/197\/a07\/4d2\/197a074d2d2bfc16c903d0a8bb3903e6.png\" alt=\"\" title=\"\" width=\"3840\" height=\"1948\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/197\/a07\/4d2\/197a074d2d2bfc16c903d0a8bb3903e6.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u044b 4 \u0433\u043e\u0434\u0430 \u043d\u0430\u0437\u0430\u0434 \u0438 electricspock, \u0432 \u0446\u0435\u043b\u043e\u043c, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0437\u0430\u0431\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u043c. \u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u0443\u043f\u0435\u0440 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. <\/p>\n<p>\u041d\u043e \u0442\u0430\u043a\u043e\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0434\u043e \u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u043a\u043e\u0433\u0434\u0430 \u0442\u0435\u0431\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e AGP (Android Gradle plugin). \u0412 \u043d\u0430\u0448\u0435\u043c \u043a\u0435\u0439\u0441\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 electricspock. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0431\u044b\u043b\u0430 \u0437\u0430\u0440\u044b\u0442\u0430 \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0438 \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0444\u043e\u0440\u043a\u0430\u0442\u044c electricspock \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0438 \u0444\u0438\u043a\u0441\u044b. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0433\u0440\u043e\u043c\u0430\u0434\u043d\u044b\u0439 bus factor, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0434\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0430, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c AGP.  <\/p>\n<p>\u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c electricspock, \u043d\u0430\u0434\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0430\u043c Spock. \u0421\u0435\u0439\u0447\u0430\u0441 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u043e\u0442\u0442\u0443\u0434\u0430 \u0442\u044b \u043f\u043e\u0439\u043c\u0435\u0448\u044c \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0441\u0443\u043f\u0435\u0440 \u0433\u043b\u0443\u0431\u043e\u043a\u043e:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/834\/a6d\/0cf\/834a6d0cf71cbdd3e5b618058f07323b.png\" width=\"1626\" height=\"894\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/834\/a6d\/0cf\/834a6d0cf71cbdd3e5b618058f07323b.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u0441 \u043a\u043b\u0430\u0441\u0441\u0430 SpockTransform. \u0422\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u0443\u0436\u0435 \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043d\u044b\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/295\/fb5\/d3e\/295fb5d3e0aa845a66d51e1b608b5fe8.jpeg\" width=\"1280\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/295\/fb5\/d3e\/295fb5d3e0aa845a66d51e1b608b5fe8.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 SpockTransform \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f SpecParser, SpecRewriter, SpecAnnotator, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 AST \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0430.  \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Sputnik \u2014 JUnit runner \u0434\u043b\u044f Spock \u0442\u0435\u0441\u0442\u043e\u0432: <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4c7\/0ad\/4ef\/4c70ad4effd9952d16fa56dcc1bdd6f6.png\" width=\"1726\" height=\"1170\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4c7\/0ad\/4ef\/4c70ad4effd9952d16fa56dcc1bdd6f6.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e, \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0440\u0430\u043d\u0442\u0430\u0439\u043c Spock \u0438 \u0442\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0444\u0438\u043a\u0441\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b electricspock: <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/521\/fc3\/dd9\/521fc3dd9ff808fd790863a6d9853da4.png\" width=\"1072\" height=\"1672\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/521\/fc3\/dd9\/521fc3dd9ff808fd790863a6d9853da4.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u043e \u043e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b bus factor \u044d\u0442\u043e \u043d\u0435 \u0441\u043f\u0430\u0441\u0430\u0435\u0442 \u0441\u043b\u043e\u0432\u0430 \u0441\u043e\u0432\u0441\u0435\u043c. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u043e, \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f Android, Gradle \u0438 AGP \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0438\u043c\u0438. <\/p>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/6c1\/44b\/1bf\/6c144b1bff921b4c0b4e029601dcf888.jpeg\" width=\"277\" height=\"182\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6c1\/44b\/1bf\/6c144b1bff921b4c0b4e029601dcf888.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441\u0442\u0430\u043b\u0438 \u0431\u0438\u0442\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u043d\u043e. \u0418 \u043c\u044b \u043f\u0440\u0438\u043d\u044f\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e Kotest, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0438\u0436\u0434\u0435\u0442\u0441\u044f \u043d\u0430 JUnit 5. \u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u0435\u0433\u043e \u0438 \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u043b\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e, \u044f \u043e\u043f\u0438\u0448\u0443 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.  \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043d\u0435\u0434\u043e\u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c Spock \u0438 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 Groovy, \u043e\u043d\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043c\u0435\u043d\u0435\u0435 \u043e\u0431\u044a\u0435\u043c\u043d\u044b\u043c\u0438 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043a\u043e\u0434\u0430 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c\u0438. <\/p>\n<hr\/>\n<p>\u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u043a\u0430\u043d\u0430\u043b<a href=\"https:\/\/t.me\/alfadigital_jobs\"><u>\u00a0Alfa Digital<\/u><\/a>\u00a0\u2014 \u0442\u0430\u043c \u043c\u044b \u043f\u043e\u0441\u0442\u0438\u043c \u043d\u043e\u0432\u043e\u0441\u0442\u0438, \u043e\u043f\u0440\u043e\u0441\u044b, \u0432\u0438\u0434\u0435\u043e \u0441 \u043c\u0438\u0442\u0430\u043f\u043e\u0432, \u043a\u0440\u0430\u0442\u043a\u0438\u0435 \u0432\u044b\u0436\u0438\u043c\u043a\u0438 \u0438\u0437 \u0441\u0442\u0430\u0442\u0435\u0439, \u0438\u043d\u043e\u0433\u0434\u0430 \u0448\u0443\u0442\u0438\u043c.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/alfa\/blog\/717892\/\"> https:\/\/habr.com\/ru\/company\/alfa\/blog\/717892\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0443 \u043c\u0435\u043d\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d \u0432\u043e\u043f\u0440\u043e\u0441 \u043a \u0442\u0435\u0431\u0435 \u0434\u043e\u0440\u043e\u0433\u043e\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c. \u041a\u043e\u0434\u0438\u043b \u043b\u0438 \u0442\u044b \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c unit \u0442\u0435\u0441\u0442\u044b \u043d\u0430 Groovy ? \u0415\u0441\u043b\u0438 \u0442\u0432\u043e\u044f \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0430\u043d\u0434\u0440\u043e\u0438\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u043c\u0430\u043b\u0430. \u0418 \u044f \u0441 \u0442\u0430\u043a\u0438\u043c \u043d\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0434\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0410\u043b\u044c\u0444\u044b.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0442\u044b \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0448\u044c \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0432\u0438\u0434\u0438\u0448\u044c \u0442\u0430\u043a\u043e\u0439 \u0442\u0435\u0441\u0442: <\/p>\n<pre><code class=\"ruby\">class InvestmentsInstrumentsRepositorySpec extends Specification {      @ClassRule     @Shared     RxJavaRule rxJavaRule      def service = Mock(InvestmentsInstrumentsService)     def repository = new InvestmentsInstrumentsRepository(service)      def 'should call service and return proper response'() {         given:             def expectedResponse = InvestmentsInstrumentsTestDataKt.getInvestmentsInstrumentsResponse()         when:             def observer = repository.getInstruments().test()         then:             1 * service.getInvestmentsInstruments() >> Single.just(expectedResponse)             observer.assertValue(expectedResponse)     } }<\/code><\/pre>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0443 \u0442\u0430\u0438\u0442\u044c, \u043c\u043e\u044f \u0440\u0435\u0430\u043a\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439:<\/p>\n<figure class=\"full-width\"><figcaption> <\/figcaption><\/figure>\n<p>\u041d\u043e \u0434\u0430\u0432\u0430\u0439 \u043f\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u043e\u043c\u0438\u0434\u043e\u0440\u044b \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0438 \u0434\u0430\u0434\u0438\u043c \u0448\u0430\u043d\u0441 \u0442\u0430\u043a\u043e\u043c\u0443 \u0442\u0435\u0441\u0442\u0443. <\/p>\n<p><strong>\u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c\u0441\u044f, \u0432 \u0446\u0435\u043b\u043e\u043c, \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0433\u043e \u0432 \u043d\u0451\u043c \u043d\u0435\u0442.<\/strong> \u042d\u0442\u043e \u0442\u0435\u0441\u0442 \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u043a\u0430\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0447\u0442\u043e \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0434\u0435\u0440\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043c\u043e\u043a\u0430. \u041f\u0440\u0438\u0447\u0435\u043c \u0442\u0435\u0441\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e, \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u043c\u0435\u0442\u043a\u0438 given\/when\/then (\u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u0430 \u0441\u0447\u0451\u0442 \u0447\u0435\u0433\u043e \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442).<\/p>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0442\u0435\u0441\u0442 \u043d\u0430 JUnit 5, \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"kotlin\">@ExtendWith(RxJavaExtension::class) class InvestmentsInstrumentsRepositoryTest {      private val service = mockk&lt;InvestmentsInstrumentsService>()     private val repository = InvestmentsInstrumentsRepository(service)      @Test     fun `should call service and return proper response`() {         \/\/ given         val expectedResponse = getInvestmentsInstrumentsResponse()         every { service.getInvestmentsInstruments() } returns Single.just(expectedResponse)         \/\/ when         val observer = repository.getInstruments().test()         \/\/ then         verify(exactly = 1) { service.getInvestmentsInstruments() }         observer.assertResult(expectedResponse)     } }<\/code><\/pre>\n<p>\u041f\u043e\u043a\u0430 \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043c\u0435\u0442\u043a\u0430\u043c\u0438 given\/when\/then \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u0438\u044f\u0442\u043d\u043e, \u043d\u043e \u0434\u0430\u0432\u0430\u0439 \u043f\u043e\u0439\u0434\u0451\u043c \u0434\u0430\u043b\u044c\u0448\u0435. <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430 Groovy \u0443 \u043d\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/github.com\/spockframework\/spock\">Spock<\/a>. Spock \u043a\u0430\u043a \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0434\u0432\u0438\u0436\u043e\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 JUnit, \u043f\u0440\u0438\u0447\u0451\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 2.x \u044d\u0442\u043e \u0443\u0436\u0435 JUnit 5. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 JUnit 4. <\/p>\n<p><strong>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043e\u043f\u0440\u043e\u0441 \u2014 \u0441\u043b\u044b\u0448\u0430\u043b \u043b\u0438 \u0442\u044b \u043f\u0440\u043e Data Driven Testing ?<\/strong> \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043f\u0440\u0438\u043c\u0435\u0440: <\/p>\n<pre><code class=\"ruby\">@Unroll     def 'should call paymentsMediator startActivity'() {         given:             featureToggle.isDisabled(Feature.REDESIGN) >> REDESIGN_TOGGLE             featureToggle.isDisabled(Feature.WIDGET_PAYMENT_HUB) >> PAYMENT_TOGGLE         when:             router.openPayScreen(expectedAccountNumber)         then:             1 * paymentsMediator.startActivity(*_) >> { activity, actualAccountNumber ->                 assert actualAccountNumber == expectedAccountNumber             }         where:             REDESIGN_TOGGLE | PAYMENT_TOGGLE             false           | true             true            | false             false           | false     }<\/code><\/pre>\n<p>\u0418 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440: <\/p>\n<pre><code class=\"ruby\">@Unroll     def 'should map unread count and reports to common items list'() {         when:             def actualMappedData = mapper.map(                     AccountStatementsTestDataKt.getReportsListResponse(),                     unreadCountResponse             )         then:             actualMappedData == expectedMappedData         where:             unreadCountResponse                                          | expectedMappedData             AccountStatementsTestDataKt.gerUnreadCountResponseWithZero() | AccountStatementsTestDataKt.getBaseItemsListWithZeroCount()             AccountStatementsTestDataKt.gerUnreadCountResponse()         | AccountStatementsTestDataKt.getBaseItemsListWithOneCount()     }<\/code><\/pre>\n<p><strong>\u0422\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438<\/strong>. \u0412 \u0431\u043b\u043e\u043a\u0435 <code>where:<\/code>  \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u0442\u0435\u0441\u0442 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0438\u0437 \u044d\u0442\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. <\/p>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u0434\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043c \u043d\u0435 \u043d\u0430\u0434\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u0441\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f. \u0422\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432 \u043e\u0434\u0438\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442. \u0418 \u0432 \u0421\u043f\u043e\u043a\u0435, \u043a\u0430\u043a \u0442\u044b \u0432\u0438\u0434\u0438\u0448\u044c, \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e. \u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043c\u043e\u0436\u0435\u0448\u044c \u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0433\u043e\u043b\u043e\u043c JUnit 4 \u0438\u043b\u0438 JUnit 5. \u0421\u043f\u043e\u0439\u043b\u0435\u0440 \u2014 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e :<\/p>\n<pre><code class=\"kotlin\">object ProvideAccountStatusNotClosed : ArgumentsProvider {          override fun provideArguments(context: ExtensionContext?): Stream&lt;out Arguments> {             return TestParamsUtils.getParams&lt;BrokerageAccountStatusesResponse>(                 InvestmentsDocumentsTestData.createBrokerageAccountStatusOpenResponse(),                 InvestmentsDocumentsTestData.createBrokerageAccountStatusPendingResponse(),                 InvestmentsDocumentsTestData.createBrokerageAccountStatusErrorResponse(),                 InvestmentsDocumentsTestData.createBrokerageAccountStatusUnknownResponse(),             )         }     }      @ParameterizedTest     @ArgumentsSource(ProvideAccountStatusNotClosed::class)     fun `should load documents if brokerage account not closed`(expectedStatusResponse: BrokerageAccountStatusesResponse) {         \/\/ when         presenter.onViewCreated()         \/\/ then         verify(exactly = 1) { mapper.prepareDocModelsList(expectedDocsResponse) }     }<\/code><\/pre>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u043f\u043e\u044d\u0442\u0438\u0447\u043d\u043e, \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0441\u044c. <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439 \u0435\u0449\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043a\u0435\u0439\u0441\u043e\u0432. \u042d\u0442\u043e \u044f \u0435\u0449\u0435 \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044e \u043e\u0431 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u043c \u0438\u043c\u0435\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u043c \u0442\u0435\u0441\u0442 \u043a\u043b\u0430\u0441\u0441\u0435. \u0410 \u0442\u0430\u043a\u0436\u0435 \u044f \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 JUnit 4 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0434\u0435\u043b\u0430 \u043e\u0431\u0441\u0442\u043e\u044f\u0442 \u0435\u0449\u0451 \u0445\u0443\u0436\u0435. <\/p>\n<p>\u0418 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0444\u0430\u043a\u0442, <strong>\u0443 \u043d\u0430\u0441 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 3 \u0442\u044b\u0441\u044f\u0447\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432.<\/strong> <\/p>\n<p>\u041d\u043e \u0443 \u0442\u0435\u0431\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441. \u00ab\u0412\u043e\u0442 \u0430\u0432\u0442\u043e\u0440 \u0442\u043e\u043b\u044c\u043a\u043e \u0438 \u0434\u0435\u043b\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0430\u0445\u0432\u0430\u043b\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 Groovy, \u0432 \u0447\u0451\u043c \u0436\u0435 \u043e\u043d \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u043b?\u00bb<\/p>\n<p>\u041d\u0435 \u0442\u043e\u0440\u043e\u043f\u0438\u0441\u044c, \u0441\u0435\u0439\u0447\u0430\u0441 \u044f \u0432\u0441\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u044f \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u043d\u0430 Groovy \ud83d\ude42<\/p>\n<h2>\u041c\u0438\u043d\u0443\u0441 \u21161 <\/h2>\n<p>\u0412\u0441\u0451 \u043b\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u0435 ? <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a, \u0447\u0442\u043e \u0432\u0441\u0451 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u0441\u0442\u0443\u0434\u0438\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u043d\u0435 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442. \u041d\u043e \u0434\u0430\u0432\u0430\u0439 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c: <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0432 \u0447\u0435\u043c \u0436\u0435 \u0434\u0435\u043b\u043e? \u0410 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <strong>\u0432 Groovy \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f<\/strong>. \u042d\u0442\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438 \u043e\u0433\u0440\u043e\u043c\u043d\u0430\u044f \u0441\u0438\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043f\u0440\u043e\u043a\u043b\u044f\u0442\u044c\u0435. <\/p>\n<p>\u041d\u043e \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d workaround, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e <a class=\"mention\" href=\"\/users\/compilestatic\">@CompileStatic<\/a>.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041c\u044b \u0437\u0430\u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442 \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041d\u043e \u044d\u0442\u0443 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u0432\u0441\u0435\u0445 \u0442\u0435\u0441\u0442\u0430\u0445, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0430 \u0443\u0431\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0438\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u0432\u044b\u0448\u0435. \u0415\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u043e\u0434\u0430 \u043c\u0430\u0440\u043a\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u0442\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0448\u044c \u043f\u043e\u043d\u044f\u0442\u044c \u0432 \u0447\u0451\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u044b\u0448\u0435 \u0441\u0442\u0440\u0435\u043b\u044f\u0435\u0442 \u0447\u0430\u0441\u0442\u043e, \u0434\u0430\u0436\u0435 \u0443 \u0442\u0435\u0445, \u043a\u0442\u043e \u0443\u0436\u0435 \u043f\u0440\u0438\u0432\u044b\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u043d\u0430 Groovy. <strong>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c, \u043f\u0435\u0440\u0432\u044b\u0439 \u0434\u0435\u043d\u044c \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438 \u0442\u0435\u0431\u044f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b.<\/strong> \u0413\u043e\u0442\u043e\u0432 \u043f\u043e\u0441\u043f\u043e\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0448\u0438\u0448\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u043f\u0440\u0435\u0436\u0434\u0435, \u0447\u0435\u043c \u0442\u0435\u0441\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f.  \u0414\u0430 \u0438 \u044f \u0435\u0449\u0451 \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435 \u043d\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0435\u0439 \u043a\u043e\u0433\u0434\u0430 \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442 \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u00ab\u0414\u0430 \u0432\u044b \u0447\u0442\u043e, \u0443\u00a0\u0432\u0430\u0441 \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u00a0Groovy!! \u041a\u0430\u043a\u00a0\u0437\u0434\u043e\u0440\u043e\u0432\u043e, \u0443\u00a0\u043c\u0435\u043d\u044f \u043a\u0430\u043a\u00a0\u0440\u0430\u0437 \u043c\u043d\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u0432\u00a0\u0442\u0430\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445!\u00bb \u0422\u043e \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<h2>\u041c\u0438\u043d\u0443\u0441 \u21162<\/h2>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442, \u0433\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0437 Android (\u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442) \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c robolectric. \u0414\u043b\u044f Spock \u0435\u0441\u0442\u044c \u043e\u0431\u0432\u044f\u0437\u043a\u0430 \u0432\u043e\u043a\u0440\u0443\u0433 robolectric, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f electricspock. <\/p>\n<p>\u0412\u0438\u0434\u0438\u0448\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u043d\u0438\u0436\u0435?<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u044b 4 \u0433\u043e\u0434\u0430 \u043d\u0430\u0437\u0430\u0434 \u0438 electricspock, \u0432 \u0446\u0435\u043b\u043e\u043c, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0437\u0430\u0431\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u043c. \u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u0443\u043f\u0435\u0440 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. <\/p>\n<p>\u041d\u043e \u0442\u0430\u043a\u043e\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0434\u043e \u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u043a\u043e\u0433\u0434\u0430 \u0442\u0435\u0431\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e AGP (Android Gradle plugin). \u0412 \u043d\u0430\u0448\u0435\u043c \u043a\u0435\u0439\u0441\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 electricspock. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0431\u044b\u043b\u0430 \u0437\u0430\u0440\u044b\u0442\u0430 \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0438 \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0444\u043e\u0440\u043a\u0430\u0442\u044c electricspock \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0438 \u0444\u0438\u043a\u0441\u044b. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0433\u0440\u043e\u043c\u0430\u0434\u043d\u044b\u0439 bus factor, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0434\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0430, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c AGP.  <\/p>\n<p>\u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c electricspock, \u043d\u0430\u0434\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0430\u043c Spock. \u0421\u0435\u0439\u0447\u0430\u0441 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u043e\u0442\u0442\u0443\u0434\u0430 \u0442\u044b \u043f\u043e\u0439\u043c\u0435\u0448\u044c \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0441\u0443\u043f\u0435\u0440 \u0433\u043b\u0443\u0431\u043e\u043a\u043e:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u0441 \u043a\u043b\u0430\u0441\u0441\u0430 SpockTransform. \u0422\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u0443\u0436\u0435 \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043d\u044b\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 SpockTransform \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f SpecParser, SpecRewriter, SpecAnnotator, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 AST \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0430.  \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Sputnik \u2014 JUnit runner \u0434\u043b\u044f Spock \u0442\u0435\u0441\u0442\u043e\u0432: <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e, \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0440\u0430\u043d\u0442\u0430\u0439\u043c Spock \u0438 \u0442\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0444\u0438\u043a\u0441\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b electricspock: <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u043e \u043e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b bus factor \u044d\u0442\u043e \u043d\u0435 \u0441\u043f\u0430\u0441\u0430\u0435\u0442 \u0441\u043b\u043e\u0432\u0430 \u0441\u043e\u0432\u0441\u0435\u043c. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u043e, \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f Android, Gradle \u0438 AGP \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0438\u043c\u0438. <\/p>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441\u0442\u0430\u043b\u0438 \u0431\u0438\u0442\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u043d\u043e. \u0418 \u043c\u044b \u043f\u0440\u0438\u043d\u044f\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e Kotest, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0438\u0436\u0434\u0435\u0442\u0441\u044f \u043d\u0430 JUnit 5. \u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u0435\u0433\u043e \u0438 \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u043b\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e, \u044f \u043e\u043f\u0438\u0448\u0443 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.  \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043d\u0435\u0434\u043e\u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c Spock \u0438 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 Groovy, \u043e\u043d\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043c\u0435\u043d\u0435\u0435 \u043e\u0431\u044a\u0435\u043c\u043d\u044b\u043c\u0438 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043a\u043e\u0434\u0430 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c\u0438. <\/p>\n<hr\/>\n<p>\u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u043a\u0430\u043d\u0430\u043b<a href=\"https:\/\/t.me\/alfadigital_jobs\"><u>\u00a0Alfa Digital<\/u><\/a>\u00a0\u2014 \u0442\u0430\u043c \u043c\u044b \u043f\u043e\u0441\u0442\u0438\u043c \u043d\u043e\u0432\u043e\u0441\u0442\u0438, \u043e\u043f\u0440\u043e\u0441\u044b, \u0432\u0438\u0434\u0435\u043e \u0441 \u043c\u0438\u0442\u0430\u043f\u043e\u0432, \u043a\u0440\u0430\u0442\u043a\u0438\u0435 \u0432\u044b\u0436\u0438\u043c\u043a\u0438 \u0438\u0437 \u0441\u0442\u0430\u0442\u0435\u0439, \u0438\u043d\u043e\u0433\u0434\u0430 \u0448\u0443\u0442\u0438\u043c.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/alfa\/blog\/717892\/\"> https:\/\/habr.com\/ru\/company\/alfa\/blog\/717892\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-345808","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/345808","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=345808"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/345808\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=345808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=345808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=345808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}