@@ -69,9 +69,7 @@ void applyCreated() {
6969 when (namespaceService .findByName ("myNamespace" )).thenReturn (Optional .of (namespace ));
7070 when (schemaService .isNamespaceOwnerOfSubject (namespace , schema .getMetadata ().getName ())).thenReturn (true );
7171 when (schemaService .validateSchemaCompatibility ("local" , schema )).thenReturn (Single .just (List .of ()));
72- when (schemaService .getLatestSubject (namespace , schema .getMetadata ().getName ()))
73- .thenReturn (Maybe .empty ())
74- .thenReturn (Maybe .just (schema ));
72+ when (schemaService .getLatestSubject (namespace , schema .getMetadata ().getName ())).thenReturn (Maybe .empty ());
7573 when (schemaService .register (namespace , schema )).thenReturn (Single .just (1 ));
7674 when (securityService .username ()).thenReturn (Optional .of ("test-user" ));
7775 when (securityService .hasRole (ResourceBasedSecurityRule .IS_ADMIN )).thenReturn (false );
@@ -92,15 +90,12 @@ void applyCreated() {
9290 void applyChanged () {
9391 Namespace namespace = buildNamespace ();
9492 Schema schema = buildSchema ();
95- Schema schemaV2 = buildSchema ();
96- schemaV2 .getSpec ().setVersion (2 );
9793
9894 when (namespaceService .findByName ("myNamespace" )).thenReturn (Optional .of (namespace ));
9995 when (schemaService .isNamespaceOwnerOfSubject (namespace , schema .getMetadata ().getName ())).thenReturn (true );
10096 when (schemaService .validateSchemaCompatibility ("local" , schema )).thenReturn (Single .just (List .of ()));
10197 when (schemaService .getLatestSubject (namespace , schema .getMetadata ().getName ()))
102- .thenReturn (Maybe .just (schema ))
103- .thenReturn (Maybe .just (schemaV2 ));
98+ .thenReturn (Maybe .just (schema ));
10499 when (schemaService .register (namespace , schema )).thenReturn (Single .just (2 ));
105100 when (securityService .username ()).thenReturn (Optional .of ("test-user" ));
106101 when (securityService .hasRole (ResourceBasedSecurityRule .IS_ADMIN )).thenReturn (false );
@@ -125,9 +120,7 @@ void applyUnchanged() {
125120 when (namespaceService .findByName ("myNamespace" )).thenReturn (Optional .of (namespace ));
126121 when (schemaService .isNamespaceOwnerOfSubject (namespace , schema .getMetadata ().getName ())).thenReturn (true );
127122 when (schemaService .validateSchemaCompatibility ("local" , schema )).thenReturn (Single .just (List .of ()));
128- when (schemaService .getLatestSubject (namespace , schema .getMetadata ().getName ()))
129- .thenReturn (Maybe .just (schema ))
130- .thenReturn (Maybe .just (schema ));
123+ when (schemaService .getLatestSubject (namespace , schema .getMetadata ().getName ())).thenReturn (Maybe .just (schema ));
131124 when (schemaService .register (namespace , schema )).thenReturn (Single .just (1 ));
132125
133126 schemaController .apply ("myNamespace" , schema , false )
0 commit comments