@@ -69,9 +69,7 @@ void applyCreated() {
69
69
when (namespaceService .findByName ("myNamespace" )).thenReturn (Optional .of (namespace ));
70
70
when (schemaService .isNamespaceOwnerOfSubject (namespace , schema .getMetadata ().getName ())).thenReturn (true );
71
71
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 ());
75
73
when (schemaService .register (namespace , schema )).thenReturn (Single .just (1 ));
76
74
when (securityService .username ()).thenReturn (Optional .of ("test-user" ));
77
75
when (securityService .hasRole (ResourceBasedSecurityRule .IS_ADMIN )).thenReturn (false );
@@ -92,15 +90,12 @@ void applyCreated() {
92
90
void applyChanged () {
93
91
Namespace namespace = buildNamespace ();
94
92
Schema schema = buildSchema ();
95
- Schema schemaV2 = buildSchema ();
96
- schemaV2 .getSpec ().setVersion (2 );
97
93
98
94
when (namespaceService .findByName ("myNamespace" )).thenReturn (Optional .of (namespace ));
99
95
when (schemaService .isNamespaceOwnerOfSubject (namespace , schema .getMetadata ().getName ())).thenReturn (true );
100
96
when (schemaService .validateSchemaCompatibility ("local" , schema )).thenReturn (Single .just (List .of ()));
101
97
when (schemaService .getLatestSubject (namespace , schema .getMetadata ().getName ()))
102
- .thenReturn (Maybe .just (schema ))
103
- .thenReturn (Maybe .just (schemaV2 ));
98
+ .thenReturn (Maybe .just (schema ));
104
99
when (schemaService .register (namespace , schema )).thenReturn (Single .just (2 ));
105
100
when (securityService .username ()).thenReturn (Optional .of ("test-user" ));
106
101
when (securityService .hasRole (ResourceBasedSecurityRule .IS_ADMIN )).thenReturn (false );
@@ -125,9 +120,7 @@ void applyUnchanged() {
125
120
when (namespaceService .findByName ("myNamespace" )).thenReturn (Optional .of (namespace ));
126
121
when (schemaService .isNamespaceOwnerOfSubject (namespace , schema .getMetadata ().getName ())).thenReturn (true );
127
122
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 ));
131
124
when (schemaService .register (namespace , schema )).thenReturn (Single .just (1 ));
132
125
133
126
schemaController .apply ("myNamespace" , schema , false )
0 commit comments